Documentation Home >> Headers >> <jss/guards.hpp> Header >> jss::generic_lock_guard >> jss::generic_lock_guard Locking Constructor

Construct a jss::generic_lock_guard instance that locks the supplied mutex.

template<typename Mutex>
explicit generic_lock_guard(Mutex& m);

Effects:

Constructs a jss::generic_lock_guard instance that references the supplied mutex. Calls m.lock().

Throws:

Any exceptions thrown by m.lock().

Postcondition:

*this owns a lock on m.

Header

#include <jss/guards.hpp>

See Also