#include <tnlThread.h>
Public Methods | |
| 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. | |
Definition at line 71 of file tnlThread.h.
|
|
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. Definition at line 165 of file thread.cpp. Referenced by TNL::ThreadQueue::lock(), TNL::EventConnection::packetDropped(), TNL::EventConnection::postNetEvent(), and TNL::EventConnection::writePacket(). |
|
|
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. Definition at line 175 of file thread.cpp. |
|
|
Unlocks the Mutex. The behavior of this method is undefined if called by a thread that has not previously locked this Mutex. Definition at line 170 of file thread.cpp. Referenced by TNL::EventConnection::packetDropped(), TNL::EventConnection::postNetEvent(), TNL::ThreadQueue::unlock(), and TNL::EventConnection::writePacket(). |
1.2.18