Documentation Home >> Headers >> <jss/guards.hpp> Header >> jss::generic_lock_guard >> jss::generic_lock_guard Lock-adopting Constructor

Construct a jss::generic_lock_guard instance that owns the lock on the supplied mutex.

template<typename Mutex>
generic_lock_guard(Mutex& m,std::adopt_lock_t);

Precondition:

The calling thread must own a lock on m.

Effects:

Constructs a jss::generic_lock_guard instance that references the supplied mutex and takes ownership of the lock on m held by the calling thread.

Throws:

Nothing.

Postcondition:

*this owns the lock on m held by the calling thread.

Header

#include <jss/guards.hpp>

See Also