#include <wefts_rmutex.h>
Inheritance diagram for Wefts::RMutex:
Public Methods | |
RMutex () | |
Initializes the internal data of the mutex. | |
virtual void | lock () |
Locks the mutex. | |
virtual void | unlock () |
Unlocks the mutex. | |
Private Attributes | |
OSThread | m_owner |
volatile int | m_lockCount |
This mutex ensures that a calling thread can lock and unlock the mutex an equal amount of times without being blocked. This allows to wrap functions that are doing a lock on a mutex around outer functions that must extend the lock in a wider area, or use the mutex in a recursive function.
|
Initializes the internal data of the mutex.
|
|
Locks the mutex. If the calling thread is already owning the lock, the function will return immediately. Anyhow, it is necessary to call the unlock() metod exactly the same amount of times that lock() has been called to ensure proper mutex releasing. Reimplemented from Wefts::Mutex. |
|
Unlocks the mutex. Releases the lock held by the calling thread. If the calling thread is not the rightful owner of the lock, the request is ignored and the call returns immediately. Reimplemented from Wefts::Mutex. |
|
|
|
|