library: libThread #include "TMutex.h"

# TMutex

class description - source file - inheritance tree (.ps)

## class TMutex : public TVirtualMutex

| Inheritance Chart:

`TObject`

<-

`TVirtualMutex`

<-

`TMutex`

        public:

                          TMutex(Bool_t recursive = kFALSE)
                          TMutex(const TMutex&)
                  virtual ~TMutex()
           static TClass* Class()
            virtual Int_t CleanUp()
          virtual TClass* IsA() const
            virtual Int_t Lock()
                  TMutex& operator=(const TMutex&)
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)
            virtual Int_t TryLock()
            virtual Int_t UnLock()

### Data Members

        private:

          TMutexImp* fMutexImp  pointer to mutex implementation
              UInt_t fId        id of thread which locked mutex
               Int_t fRef       reference count in case of recursive locking by same thread

## Class Description

     TMutex

     This class implements mutex locks. A mutex is a mutual exclusive
     lock. The actual work is done via the TMutexImp class (either
     TPosixMutex, TSolarisMutex or TNTMutex).

TMutex(Bool_t recursive)

     Create a mutex lock. The actual mutex implementation will be
     provided via the TThreadFactory.

Int_t Lock()

     Lock the mutex. Returns 0 when no error, 13 when mutex was already locked
     by this thread.

Int_t TryLock()

     Try to lock mutex. Returns 0 when no error, 13 when mutex was already
     locked by this thread.

Int_t UnLock()

     Unlock the mutex. Returns 0 when no error, 13 when mutex was already
     locked by this thread.

Int_t CleanUp()

     Clean up of mutex if it belongs to thread.

### Inline Functions

                   void ~TMutex()
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)
                 TMutex TMutex(const TMutex&)
                TMutex& operator=(const TMutex&)

Author: Fons Rademakers 26/06/97
Last update: root/thread:$Name: $:$Id: TMutex.cxx,v 1.2 2002/02/14 16:12:52 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *