#include <yateclass.h>
Inheritance diagram for Mutex:
Public Member Functions | |
Mutex () | |
Mutex (bool recursive) | |
Mutex (const Mutex &original) | |
~Mutex () | |
Mutex & | operator= (const Mutex &original) |
bool | lock (long maxwait=-1) |
void | unlock () |
bool | locked () const |
bool | check (long maxwait=-1) |
bool | recursive () const |
Static Public Member Functions | |
static int | count () |
static int | locks () |
static void | wait (unsigned long maxwait) |
Friends | |
class | MutexPrivate |
A simple mutual exclusion for locking access between threads
|
Construct a new unlocked fast mutex |
|
Construct a new unlocked mutex
|
|
Copy constructor creates a shared mutex
|
|
Destroy the mutex |
|
Check if the mutex is unlocked (try to lock and unlock the mutex)
|
|
Get the number of mutexes counting the shared ones only once
|
|
Attempt to lock the mutex and eventually wait for it
|
|
Check if the mutex is currently locked - as it's asynchronous it guarantees nothing if other thread changes the mutex's status
|
|
Get the number of currently locked mutexes
|
|
Assignment operator makes the mutex shared with the original
|
|
Check if this mutex is recursive or not
|
|
Unlock the mutex, does never wait |
|
Set a maximum mutex wait time for debugging purposes
|