cgv
|
#include <mutex.h>
Public Member Functions | |
condition_mutex () | |
construct a mutex | |
~condition_mutex () | |
destruct a mutex | |
void | send_signal () |
send the signal to unblock a thread waiting for the condition represented by this condition_mutex | |
void | send_signal_with_lock () |
prefered approach to send the signal and implemented as {lock();send_signal();unlock();} | |
void | broadcast_signal () |
broadcast signal to unblock several threads waiting for the condition represented by this condition_mutex | |
void | broadcast_signal_with_lock () |
prefered approach to broadcast the signal and implemented as {lock();broadcast_signal();unlock();} | |
bool | try_lock () |
try to lock the mutex (return false if the mutex is still locked) | |
void | lock () |
lock the mutex (if the mutex is already locked, the caller is blocked until the mutex becomes available) More... | |
void | unlock () |
unlock the mutex | |
void | debug_lock (const std::string &info) |
same as lock but with printing debug information | |
void | debug_unlock (const std::string &info) |
same unlock but with printing debug information | |
Static Public Member Functions | |
static unsigned | get_debug_lock_counter () |
return the global locking counter that is used for mutex debugging | |
A mutex that can wake up other threads by signals sent when a condition is fulfilled
|
inherited |
lock the mutex (if the mutex is already locked, the caller is blocked until the mutex becomes available)
lock the mutex (if the mutex is still locked, the caller is blocked until the mutex becomes available)