Logo ROOT   6.18/05
Reference Guide
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
TMutex Class Reference

Definition at line 30 of file TMutex.h.

Public Member Functions

 TMutex (Bool_t recursive=kFALSE)
 Create a mutex lock. More...
 
virtual ~TMutex ()
 
Int_t CleanUp ()
 Clean up of mutex. More...
 
TVirtualMutexFactory (Bool_t recursive=kFALSE)
 Create mutex and return pointer to it. More...
 
Int_t Lock ()
 Lock the mutex. More...
 
void lock ()
 
Int_t TryLock ()
 Try to lock mutex. More...
 
Int_t UnLock ()
 Unlock the mutex. More...
 
void unlock ()
 
- Public Member Functions inherited from TVirtualMutex
 TVirtualMutex (Bool_t=kFALSE)
 
virtual ~TVirtualMutex ()
 
Int_t Acquire ()
 
virtual Int_t CleanUp ()=0
 
virtual TVirtualMutexFactory (Bool_t=kFALSE)=0
 
virtual Int_t Lock ()=0
 
Int_t Release ()
 
virtual Int_t TryLock ()=0
 
virtual Int_t UnLock ()=0
 

Private Member Functions

 TMutex (const TMutex &)
 
TMutexoperator= (const TMutex &)
 

Private Attributes

TMutexImpfMutexImp
 

Friends

class TCondition
 
class TThread
 

#include <TMutex.h>

Inheritance diagram for TMutex:
[legend]

Constructor & Destructor Documentation

◆ TMutex() [1/2]

TMutex::TMutex ( const TMutex )
private

◆ TMutex() [2/2]

TMutex::TMutex ( Bool_t  recursive = kFALSE)

Create a mutex lock.

The actual mutex implementation will be provided via the TThreadFactory.

Definition at line 34 of file TMutex.cxx.

◆ ~TMutex()

virtual TMutex::~TMutex ( )
inlinevirtual

Definition at line 43 of file TMutex.h.

Member Function Documentation

◆ CleanUp()

Int_t TMutex::CleanUp ( )
virtual

Clean up of mutex.

Implements TVirtualMutex.

Definition at line 76 of file TMutex.cxx.

◆ Factory()

TVirtualMutex * TMutex::Factory ( Bool_t  recursive = kFALSE)
virtual

Create mutex and return pointer to it.

Calling function must care about proper deletion. The function is intended to be used in connection with the R__LOCKGUARD2 macro for local thread protection. Since "new" is used the TStorage class has to be protected by gGlobalMutex.

Implements TVirtualMutex.

Definition at line 87 of file TMutex.cxx.

◆ Lock()

Int_t TMutex::Lock ( )
virtual

Lock the mutex.

Returns 0 when no error, EDEADLK when mutex was already locked by this thread and this mutex is not reentrant.

Implements TVirtualMutex.

Definition at line 46 of file TMutex.cxx.

◆ lock()

void TMutex::lock ( )
inline

Definition at line 51 of file TMutex.h.

◆ operator=()

TMutex & TMutex::operator= ( const TMutex )
private

◆ TryLock()

Int_t TMutex::TryLock ( )
virtual

Try to lock mutex.

Returns 0 when no error, EDEADLK when mutex was already locked by this thread and this mutex is not reentrant.

Implements TVirtualMutex.

Definition at line 57 of file TMutex.cxx.

◆ UnLock()

Int_t TMutex::UnLock ( )
virtual

Unlock the mutex.

Returns 0 when no error, EPERM when mutex was already unlocked by this thread.

Implements TVirtualMutex.

Definition at line 68 of file TMutex.cxx.

◆ unlock()

void TMutex::unlock ( )
inline

Definition at line 52 of file TMutex.h.

Friends And Related Function Documentation

◆ TCondition

friend class TCondition
friend

Definition at line 32 of file TMutex.h.

◆ TThread

friend class TThread
friend

Definition at line 33 of file TMutex.h.

Member Data Documentation

◆ fMutexImp

TMutexImp* TMutex::fMutexImp
private

Definition at line 36 of file TMutex.h.

Libraries for TMutex:
[legend]

The documentation for this class was generated from the following files: