Documentation Home >> Headers >> <mutex> Header >> std::unique_lock >> std::unique_lock Locking Constructor

Construct a std::unique_lock instance that locks the supplied mutex.

explicit unique_lock(mutex_type& m);

Effects:

Constructs a std::unique_lock instance that references the supplied mutex. Calls m.lock().

Throws:

Any exceptions thrown by m.lock().

Postcondition:

this->owns_lock()==true, this->mutex()==&m.

Header

#include <mutex>

See Also