Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Constructs a lock_guard object.
explicit lock_guard(mutex_type& Mtx);
lock_guard(mutex_type& Mtx, adopt_lock_t);
Parameters
- Mtx
A mutex type object.
Remarks
The first constructor constructs an object of type lock_guard and locks Mtx. If Mtx is not a recursive mutex, it must be unlocked when this constructor is called.
The second constructor does not lock Mtx. Mtx must be locked when this constructor is called. The constructor throws no exceptions.
Requirements
Header: mutex
Namespace: std