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_lockinstance that references the supplied mutex. Callsm.try_lock().- Throws:
Nothing.
- Postcondition:
this->owns_lock()returns the result of them.try_lock()call,this->mutex()==&m.
Header
#include <mutex>