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

Construct a jss::lock_guard instance that owns the lock on the supplied lockable objects.

lock_guard(LockableTypes& ... m,std::adopt_lock_t);

Precondition:

The calling thread must own a lock on all the lockable objects in m.

Effects:

Constructs a jss::lock_guard instance that references the supplied lockable objects and takes ownership of the lock on all the lockable objects in m held by the calling thread.

Throws:

Nothing.

Postcondition:

*this owns the lock on all the lockable objects in m held by the calling thread.

Header

#include <jss/guards.hpp>

See Also