Construct a std::lock_guard instance that owns
the lock on the supplied mutex.
lock_guard(mutex_type& m,std::adopt_lock_t);
- Precondition:
The calling thread must own a lock on
m.- Effects:
Constructs a
std::lock_guardinstance that references the supplied mutex and takes ownership of the lock onmheld by the calling thread.- Throws:
Nothing.
- Postcondition:
*thisowns the lock onmheld by the calling thread.
Header
#include <mutex>