Mutex class that avoids trips into the kernel until there's contention for the mutex.
Public Member Functions
|Mutex_t (bool allow_recursive_lock=false)|
|Mutex_t::Mutex_t||(||bool|| allow_recursive_lock =
Mutex constructor. If allow_recursive_lock is true, the same thread which holds the mutex can recursively acquire it.
Locks the mutex. Note that if the calling thread already holds the mutex, it cannot reacquire the mutex and an assertion failure will occur. While some mutex implementations allow a thread which holds the mutex to recursively acquire more lock references, that encourages sloppy synchronization design in general, which usually manifests itself in the form of deadlocks which are usually difficult to debug.
Unlocks the mutex.