#include <Mutex.h>
Public Member Functions | |
| Mutex (GlobalData *globalData) | |
| virtual | ~Mutex () |
| bool | iHoldIt () const |
| void | acquire () |
| void | release () |
|
|
Mutex constructor.
|
|
|
Destroy the mutex, releasing it if still held. |
|
|
Acquire the mutex for the current thread, or just increment its internal counter if the current thread already holds the mutex. If some other thread currently holds the mutex, the current thread will block until the mutex is fully released by its current holder. |
|
|
Return `true' if the current thread acquired the mutex. |
|
|
Release the mutex. This should only be called by the thread that actually holds the mutex. Attempts to do otherwise will most likely fuck up your synchronization logic. To be fully released, a mutex must be released a number of times equal to the number of times it has been acquired. All in the same thread, of course. |
1.3.9.1