#include <cel_syncobjs.h>
Public Member Functions | |
Mutex () | |
Mutex (int inDummy) | |
~Mutex () | |
virtual void | lock () const |
virtual void | unlock () const |
void * | getContext () const |
This class implements Mutex. The Mutex is identical to binary Semaphore except it accepts recursive lock in the same thread and it is far faster than Semaphore.
This class has its own DataTraits structure and it can be used with SimpleArray with some special restrictions; you can create, allocate, release the array of Mutex instances but you could not reallocate (resize) the array.
Celartem::Mutex::Mutex | ( | ) |
Initializes recursive Mutex instance.
Celartem::Mutex::Mutex | ( | int | inDummy | ) |
Initializes non recursive Mutex instance.
inDummy | Dummy parameter which tells this constructor from the other one. |
Celartem::Mutex::~Mutex | ( | ) |
Uninitializes the instance.
|
inline |
Reserved for internal use only.
|
virtual |
Locks the mutex. The recursive locks are accepted in the same thread.
For exception-safe programming, you should use Locker class instead of calling lock and unlock directly.
Implements Celartem::Lockable.
Referenced by Celartem::DjVu::StorageData::lock(), and Celartem::DjVu::MemoryData::lock().
|
virtual |
Unlocks the mutex.
For exception-safe programming, you should use Locker class instead of calling lock and unlock directly.
Implements Celartem::Lockable.
Referenced by Celartem::DjVu::StorageData::unlock(), and Celartem::DjVu::MemoryData::unlock().