just::thread Complete C++ Standard Thread Library by Just Software Solutions

Documentation Home >> Headers >> <mutex> Header >> std::unique_lock >> std::unique_lock Try-to-lock Constructor

Construct a std::unique_lock instance associated with the supplied mutex and tries to acquire a lock on that mutex.

unique_lock(mutex_type& m,std::try_to_lock_t);

Effects:

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

Throws:

Nothing.

Postcondition:

this->owns_lock() returns the result of the m.try_lock() call, this->mutex()==&m.

Header

#include <mutex>

See Also