ui-utilcpp 1.10.1
|
Mutex Lock class; an object of this class will guard a scope. More...
#include <Misc.hpp>
Public Types | |
enum | ErrorCode { Locked_ = 1 } |
Error codes for exceptions. | |
typedef CodeException< ErrorCode > | Exception |
This classes exceptions. | |
Public Member Functions | |
MutexLock (Mutex &mutex, bool wait=true) | |
Constructor; locks the mutex. More... | |
~MutexLock () | |
Destructor; unlocks the mutex. | |
Mutex Lock class; an object of this class will guard a scope.
The Mutex class must provide enterMutex(), tryEnterMutex() and leaveMutex() methods.
|
inline |
Constructor; locks the mutex.
mutex | Any Mutex providing enterMutex(), tryEnterMutex() and leaveMutex(). |
wait | Whether to wait until the lock can be set, or to return with exception LOCKED. |
References UI_THROW_CODE.