This class is used to automatically lock and unlock a mutex. The constructor calls lock() and the destructor calls unlock(). This makes it impossible to leave a block containing a Lock object without unlocking the mutex. More...
#include <Lock.h>
Public Member Functions | |
Lock (AbstractMutex &m) | |
Lock the associated mutex. | |
~Lock () | |
unlock the associated mutex | |
Private Member Functions | |
Lock (const Lock &) | |
void | operator= (const AbstractMutex &) |
Private Attributes | |
AbstractMutex * | m_ |
This class is used to automatically lock and unlock a mutex. The constructor calls lock() and the destructor calls unlock(). This makes it impossible to leave a block containing a Lock object without unlocking the mutex.
Definition at line 18 of file Lock.h.
fesa::Lock::Lock | ( | AbstractMutex & | m | ) | [inline] |
Lock the associated mutex.
Definition at line 25 of file Lock.h.
References fesa::AbstractMutex::lock(), and m_.
fesa::Lock::~Lock | ( | ) | [inline] |
unlock the associated mutex
Definition at line 30 of file Lock.h.
References m_, and fesa::AbstractMutex::unlock().
fesa::Lock::Lock | ( | const Lock & | ) | [private] |
void fesa::Lock::operator= | ( | const AbstractMutex & | ) | [private] |
AbstractMutex* fesa::Lock::m_ [private] |