#include <tnlThread.h>
Public Member Functions | |
Mutex () | |
Mutex constructor. | |
~Mutex () | |
Mutex destructor. | |
void | lock () |
Locks the Mutex. | |
void | unlock () |
Unlocks the Mutex. | |
bool | tryLock () |
Attempts to acquire a lock to this Mutex, without blocking. | |
Private Attributes | |
pthread_mutex_t | mMutex |
|
Mutex constructor.
|
|
Mutex destructor.
|
|
Locks the Mutex. If another thread already has this Mutex locked, this call will block until it is unlocked. If the lock method is called from a thread that has already locked this Mutex, the call will not block and the thread will have to unlock the mutex for as many calls as were made to lock before another thread will be allowed to lock the Mutex. |
|
Unlocks the Mutex. The behavior of this method is undefined if called by a thread that has not previously locked this Mutex. |
|
Attempts to acquire a lock to this Mutex, without blocking. Returns true if the calling thread was able to lock the Mutex and false if the Mutex was already locked by another thread. |
|
|