casa
5.7.0-16
|
Exception-safe lock/unlock of a mutex. More...
#include <Mutex.h>
Public Member Functions | |
ScopedMutexLock (Mutex &mutex) | |
Create a lock on the mutex. More... | |
~ScopedMutexLock () | |
The destructor automatically unlocks the mutex. More... | |
Private Member Functions | |
ScopedMutexLock (const ScopedMutexLock &) | |
Forbid copy constructor. More... | |
ScopedMutexLock & | operator= (const ScopedMutexLock &) |
Forbid assignment. More... | |
Private Attributes | |
Mutex & | itsMutexRef |
Exception-safe lock/unlock of a mutex.
Public interface
The constructor of this class locks a mutex, while the destructor unlocks it. In this way the user does not need to take care of unlocking a mutex and is mutex locking fully exception-safe
|
inline |
Create a lock on the mutex.
Definition at line 150 of file Mutex.h.
References itsMutexRef, and casacore::Mutex::lock().
|
inline |
The destructor automatically unlocks the mutex.
Definition at line 155 of file Mutex.h.
References itsMutexRef, and casacore::Mutex::unlock().
|
private |
Forbid copy constructor.
|
private |
Forbid assignment.
|
private |
Definition at line 164 of file Mutex.h.
Referenced by ScopedMutexLock(), and ~ScopedMutexLock().