Documentation Home >> Headers >> <mutex> Header >> std::recursive_mutex >> std::recursive_mutex::unlock Member Function

Releases a lock on a std::recursive_mutex object held by the current thread.

void unlock();

Preconditions:

The calling thread must hold a lock on *this.

Effects:

Releases a lock on *this held by the current thread. If this is the last lock on *this held by the calling thread, any threads are blocked waiting to acquire a lock on *this, unblock one of them.

Postconditions:

The number of locks on *this held by the calling thread is reduced by one.

Throws:

Nothing.

Header

#include <mutex>

See Also