Open CASCADE Technology
7.5.0
|
Simple sentry class providing convenient interface to mutex. More...
#include <Standard_Mutex.hxx>
Public Member Functions | |
Sentry (Standard_Mutex &theMutex) | |
Constructor - initializes the sentry object by reference to a mutex (which must be initialized) and locks the mutex immediately. More... | |
Sentry (Standard_Mutex *theMutex) | |
Constructor - initializes the sentry object by pointer to a mutex and locks the mutex if its pointer is not NULL. More... | |
~Sentry () | |
Destructor - unlocks the mutex if already locked. More... | |
Simple sentry class providing convenient interface to mutex.
Provides automatic locking and unlocking a mutex in its constructor and destructor, thus ensuring correct unlock of the mutex even in case of raising an exception or signal from the protected code.
Create instance of that class when entering critical section.
|
inline |
Constructor - initializes the sentry object by reference to a mutex (which must be initialized) and locks the mutex immediately.
|
inline |
Constructor - initializes the sentry object by pointer to a mutex and locks the mutex if its pointer is not NULL.
|
inline |
Destructor - unlocks the mutex if already locked.