|
|
A simple mutual exclusion for locking access between threads
Mutex ()
| Mutex |
Construct a new unlocked fast mutex
Mutex (bool recursive)
| Mutex |
Construct a new unlocked mutex
Parameters:
recursive | True if the mutex has to be recursive (reentrant), false for a normal fast mutex |
Mutex (const Mutex& original)
| Mutex |
Copy constructor creates a shared mutex
Parameters:
original | Reference of the mutex to share |
~Mutex ()
| ~Mutex |
Destroy the mutex
Mutex& operator= (const Mutex& original)
| operator= |
Assignment operator makes the mutex shared with the original
Parameters:
original | Reference of the mutex to share |
bool lock (long maxwait = -1)
| lock |
Attempt to lock the mutex and eventually wait for it
Parameters:
maxwait | Time in microseconds to wait for the mutex, -1 wait forever |
Returns: True if successfully locked, false on failure
void unlock ()
| unlock |
Unlock the mutex, does never wait
bool locked ()
| locked |
[const]
Check if the mutex is currently locked - as it's asynchronous it guarantees nothing if other thread changes the mutex's status
Returns: True if the mutex was locked when the function was called
bool check (long maxwait = -1)
| check |
Check if the mutex is unlocked (try to lock and unlock the mutex)
Parameters:
maxwait | Time in microseconds to wait for the mutex, -1 wait forever |
Returns: True if successfully locked and unlocked, false on failure
bool recursive ()
| recursive |
[const]
Check if this mutex is recursive or not
Returns: True if this is a recursive mutex, false for a fast mutex
int count ()
| count |
[static]
Get the number of mutexes counting the shared ones only once
Returns: Count of individual mutexes
int locks ()
| locks |
[static]
Get the number of currently locked mutexes
Returns: Count of locked mutexes, should be zero at program exit
void wait (unsigned long maxwait)
| wait |
[static]
Set a maximum mutex wait time for debugging purposes
Parameters:
maxwait | Maximum time in microseconds to wait for any mutex when no time limit was requested, zero to disable limit |
Generated by: root on dragoshel on Sat Apr 14 01:50:50 2007, using kdoc 2.0a54. |