cpp/thread/recursive mutex

The class is a synchronization primitive that can be used to protect shared data from being simultaneously accessed by multiple threads.

offers exclusive, recursive ownership semantics:


 * A calling thread owns a for a period of time that starts when it successfully calls either cpp/thread/recursive_mutex/lock or cpp/thread/mutex/try_lock.  During this period, the thread may make additional calls to cpp/thread/recursive_mutex/lock or cpp/thread/recursive_mutex/try_lock.  The period of ownership ends when the thread makes a matching number of calls to cpp/thread/recursive_mutex/unlock.
 * When a thread owns a, all other threads will block (for calls to cpp/thread/recursive_mutex/lock) or receive a return value (for cpp/thread/recursive_mutex/try_lock) if they attempt to claim ownership of the.
 * The maximum number of times that a may be locked is unspecified, but after that number is reached, calls to cpp/thread/recursive_mutex/lock will throw std and calls to cpp/thread/mutex/try_lock will return.

The behavior of a program is undefined if a is destroyed while still owned by some thread. The class satisfies all requirements of  and.