CppCMS
|
Recursive mutex object. More...
#include <booster/booster/thread.h>
Public Member Functions | |
void | lock () |
void | unlock () |
Recursive mutex object.
Unlike mutex, when the same thread tries to lock the mutex that is already locked it would succeed and would require to unlock it same times it was locked.
Useful for handling objects locks when the order of functions calls is not known in advice. For example
void foo() { unique_lock<recursive_mutex> guard(this->lock); bar(); baz(); } void bar() { unique_lock<recursive_mutex> guard(this->lock); ... }
void booster::recursive_mutex::lock | ( | ) |
Lock the mutex.
void booster::recursive_mutex::unlock | ( | ) |
Unlock the mutex,