class
<mutex>

std::recursive_mutex

class recursive_mutex;
Recursive mutex class
A recursive mutex is a lockable object, just like mutex, but allows the same thread to acquire multiple levels of ownership over the mutex object.

This allows to lock (or try-lock) the mutex object from a thread that is already locking it, acquiring a new level of ownership over the mutex object: the mutex object will actually remain locked owning the thread until its member unlock is called as many times as this level of ownership.

It is guaranteed to be a standard-layout class.

Member types

member typedescription
native_handle_typeType returned by native_handle (only defined if library implementation supports it)

Member functions