GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4LockGuard Class Reference

#include <TGo4LockGuard.h>

Public Member Functions

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

Static Public Member Functions

static void LockMainMutex ()
 
static Int_t MainMutexLockCount ()
 
static void UnLockMainMutex ()
 

Private Attributes

int dummy
 
Bool_t fbIsLocked {kFALSE}
 We need this flag if first TThread starts in between ctor and dtor.
 
Bool_t fbIsMainMutex {kFALSE}
 True if the mutex of this lockguard instance is the global go4 main mutex.
 
TMutex * fxMutex {nullptr}
 Reference to Mutex associated with this lockguard (external or internal)
 

Static Private Attributes

static Int_t fgiLockCount = 0
 Counts the numbers of locks of the recursive main mutex.
 
static TMutex * fgxMainMutex = nullptr
 Main Mutex of the go4 system.
 

Detailed Description

Definition at line 40 of file TGo4LockGuard.h.

Constructor & Destructor Documentation

◆ TGo4LockGuard() [1/3]

TGo4LockGuard::TGo4LockGuard ( TMutex * mutex = nullptr,
Bool_t = kFALSE )

Definition at line 23 of file TGo4LockGuard.cxx.

References TGo4LockGuard(), fbIsLocked, fbIsMainMutex, fgiLockCount, fgxMainMutex, and fxMutex.

Referenced by TGo4LockGuard().

◆ ~TGo4LockGuard()

TGo4LockGuard::~TGo4LockGuard ( )
virtual

Definition at line 45 of file TGo4LockGuard.cxx.

References ~TGo4LockGuard(), fbIsLocked, fbIsMainMutex, fgiLockCount, and fxMutex.

Referenced by ~TGo4LockGuard().

◆ TGo4LockGuard() [2/3]

TGo4LockGuard::TGo4LockGuard ( )
inline

Definition at line 24 of file TGo4LockGuard.h.

References dummy.

◆ TGo4LockGuard() [3/3]

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

Definition at line 25 of file TGo4LockGuard.h.

References dummy.

Member Function Documentation

◆ LockMainMutex()

void TGo4LockGuard::LockMainMutex ( )
static

Definition at line 58 of file TGo4LockGuard.cxx.

References fgxMainMutex, and LockMainMutex().

Referenced by LockMainMutex().

◆ MainMutexLockCount()

Int_t TGo4LockGuard::MainMutexLockCount ( )
static

Definition at line 53 of file TGo4LockGuard.cxx.

References fgiLockCount, and MainMutexLockCount().

Referenced by MainMutexLockCount().

◆ UnLockMainMutex()

void TGo4LockGuard::UnLockMainMutex ( )
static

Definition at line 63 of file TGo4LockGuard.cxx.

References fgxMainMutex, and UnLockMainMutex().

Referenced by UnLockMainMutex().

Field Documentation

◆ dummy

int TGo4LockGuard::dummy
private

Definition at line 28 of file TGo4LockGuard.h.

Referenced by TGo4LockGuard(), and TGo4LockGuard().

◆ fbIsLocked

Bool_t TGo4LockGuard::fbIsLocked {kFALSE}
private

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

Definition at line 59 of file TGo4LockGuard.h.

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

◆ fbIsMainMutex

Bool_t TGo4LockGuard::fbIsMainMutex {kFALSE}
private

True if the mutex of this lockguard instance is the global go4 main mutex.

Definition at line 63 of file TGo4LockGuard.h.

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

◆ fgiLockCount

Int_t TGo4LockGuard::fgiLockCount = 0
staticprivate

Counts the numbers of locks of the recursive main mutex.

Definition at line 72 of file TGo4LockGuard.h.

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

◆ fgxMainMutex

TMutex * TGo4LockGuard::fgxMainMutex = nullptr
staticprivate

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 69 of file TGo4LockGuard.h.

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

◆ fxMutex

TMutex* TGo4LockGuard::fxMutex {nullptr}
private

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

Definition at line 56 of file TGo4LockGuard.h.

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


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