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

Construct a jss::lock_guard instance that locks the supplied lockable objects.

explicit lock_guard(LockableTypes& ...  m);

Effects:

Constructs a jss::lock_guard instance that references the supplied mutexes. Uses an algorithm equivalent to std::lock(m....) to lock all of the supplied lockable objects without deadlock.

Throws:

Any exceptions thrown by any of the calls to acquire the locks on the lockable objects.

Postcondition:

*this owns a lock on all the lockable objects in m.

Header

#include <jss/guards.hpp>

See Also