![]() |
PIP 5.5.3
Platform-Independent Primitives
|
PIMutex autolocker More...
#include <pimutex.h>
Public Member Functions | |
| PIMutexLocker (PIMutex &m, bool condition=true) | |
Constructs and lock "m" if "condition" is true. | |
| ~PIMutexLocker () | |
Unlock "m" if "condition" was true. | |
PIMutex autolocker
When a PIMutexLocker object is created, it attempts to lock the mutex it is given, if "condition" true. When control leaves the scope in which the PIMutexLocker object was created, the PIMutexLocker is destructed and the mutex is released, if "condition" was true.
If "condition" false this class do nothing.
The PIMutexLocker class is non-copyable.