Documentation Home

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

explicit shared_lock(mutex_type& m);

Effects:

Constructs a std::shared_lock instance that references the supplied mutex. Calls m.lock_shared().

Throws:

Any exceptions thrown by m.lock_shared().

Postcondition:

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

Header

#include <shared_mutex>

See Also