Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes

TGo4LockGuard Class Reference

#include <TGo4LockGuard.h>

List of all members.

Public Member Functions

 TGo4LockGuard (TMutex *mutex=0, Bool_t forcelock=kFALSE)
virtual ~TGo4LockGuard ()
 TGo4LockGuard ()
 TGo4LockGuard (int i, bool force=false)

Static Public Member Functions

static void LockMainMutex ()
static void UnLockMainMutex ()

Private Attributes

TMutex * fxMutex
Bool_t fbIsLocked
Bool_t fbIsMainMutex
int dummy

Static Private Attributes

static TMutex * fgxMainMutex = 0
static Int_t fgiLockCount = 0

Detailed Description

Definition at line 40 of file TGo4LockGuard.h.


Constructor & Destructor Documentation

TGo4LockGuard::TGo4LockGuard ( TMutex *  mutex = 0,
Bool_t  forcelock = kFALSE 
)

Definition at line 23 of file TGo4LockGuard.cxx.

References fbIsLocked, fbIsMainMutex, fgiLockCount, fgxMainMutex, and fxMutex.

TGo4LockGuard::~TGo4LockGuard (  )  [virtual]

Definition at line 82 of file TGo4LockGuard.cxx.

References fbIsLocked, fbIsMainMutex, fgiLockCount, and fxMutex.

TGo4LockGuard::TGo4LockGuard (  )  [inline]

Definition at line 24 of file TGo4LockGuard.h.

TGo4LockGuard::TGo4LockGuard ( int  i,
bool  force = false 
) [inline]

Definition at line 25 of file TGo4LockGuard.h.


Member Function Documentation

void TGo4LockGuard::LockMainMutex (  )  [static]

Definition at line 111 of file TGo4LockGuard.cxx.

References fgxMainMutex.

Referenced by TGo4Task::LockAll(), TGo4ServerTask::LockAll(), and TGo4Socket::Send().

void TGo4LockGuard::UnLockMainMutex (  )  [static]

Definition at line 116 of file TGo4LockGuard.cxx.

References fgxMainMutex.

Referenced by TGo4Socket::Send(), TGo4Task::UnLockAll(), and TGo4ServerTask::UnLockAll().


Member Data Documentation

int TGo4LockGuard::dummy [private]

Definition at line 25 of file TGo4LockGuard.h.

Bool_t TGo4LockGuard::fbIsLocked [private]

We need this flag if first TThread starts in between ctor and dtor.

Definition at line 58 of file TGo4LockGuard.h.

Referenced by TGo4LockGuard(), and ~TGo4LockGuard().

Bool_t TGo4LockGuard::fbIsMainMutex [private]

If true, lock anyway even if no ROOT thread exists. required to protect against foreign pthreads, e.g. from DIM True if the mutex of this lockguard instance is the global go4 main mutex.

Definition at line 66 of file TGo4LockGuard.h.

Referenced by TGo4LockGuard(), and ~TGo4LockGuard().

Int_t TGo4LockGuard::fgiLockCount = 0 [static, private]

Counts the numbers of locks of the recursive main mutex.

Definition at line 75 of file TGo4LockGuard.h.

Referenced by TGo4LockGuard(), and ~TGo4LockGuard().

TMutex * TGo4LockGuard::fgxMainMutex = 0 [static, private]

Main Mutex of the go4 system. Used to protect any memory critical operations. This mutex is applied if lockguard is called without giving external mutex.

Definition at line 72 of file TGo4LockGuard.h.

Referenced by LockMainMutex(), TGo4LockGuard(), and UnLockMainMutex().

TMutex* TGo4LockGuard::fxMutex [private]

Reference to Mutex associated with this lockguard (external or internal)

Definition at line 55 of file TGo4LockGuard.h.

Referenced by TGo4LockGuard(), and ~TGo4LockGuard().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines