Open CASCADE Technology
6.5.4
|
Advanced Sentry class providing convenient interface to manipulate a mutex from one thread. More...
#include <Standard_Mutex.hxx>
Public Member Functions | |
SentryNested (Standard_Mutex &theMutex, Standard_Boolean doLock=Standard_True) | |
Constructor - initializes the sentry object by reference to a mutex (which must be initialized). Locks the mutex immediately unless Standard_False is given as second argument. | |
~SentryNested () | |
Destructor - unlocks the mutex if already locked. | |
void | Lock () |
Lock the mutex. | |
void | Unlock () |
Unlock the mutex. |
As compared with simple Sentry class, provides possibility to lock and unlock mutex at any moment, and perform nested lock/unlock actions (using lock counter). However all calls must be from within the same thread; this is to be ensured by the code using this class.
Standard_Mutex::SentryNested::SentryNested | ( | Standard_Mutex & | theMutex, |
Standard_Boolean | doLock = Standard_True |
||
) | [inline] |
Standard_Mutex::SentryNested::~SentryNested | ( | ) | [inline] |
void Standard_Mutex::SentryNested::Lock | ( | ) | [inline] |
void Standard_Mutex::SentryNested::Unlock | ( | ) | [inline] |