function template provides a means of locking more than one mutex at the
same time, without risk of deadlock due to inconsistent lock orders.
template< typename LockableType1,typename... LockableType2> void lock(LockableType1& m1,LockableType2& m2...);
The types of the supplied lockable objects
shall conform to the
Acquires a lock on each of the supplied lockable objects
... by an unspecified sequence of calls to the
unlock() members of those types that avoids
The current thread owns a lock on each of the supplied lockable objects.
Any exceptions thrown by the calls to
If an exception propagates out of the call to
shall have been called for any of the objects
m2, ... for which
a lock has been acquired in the function by a call to
On compilers that don't support variadic templates, an overloaded set of function templates is provided that supports passing of up to 5 arguments.