Documentation Home

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

explicit scoped_lock(LockableTypes& ...  m);

Effects:

Constructs a jss::scoped_lock 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