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

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

void unlock();

Preconditions:

The calling thread must hold a lock on *this.

Effects:

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

Postconditions:

*this is not locked by the calling thread.

Throws:

Nothing.

Header

#include <mutex>

See Also