Effects: Calls try_lock() for each argument in order beginning with the
first until all arguments have been processed or a call to try_lock() fails,
either by returning false or by throwing an exception.
If a call to
try_lock() fails, unlock() is called for all prior arguments
with no further calls to try_lock().
Returns:-1 if all calls to try_lock() returned true,
otherwise a zero-based index value that indicates the argument for which try_lock()
returned false.
A deadlock avoidance
algorithm such as try-and-back-off must be used, but the specific algorithm is not
specified to avoid over-constraining implementations.
— end note
]
If a call to
lock() or try_lock() throws an exception, unlock() is
called for any argument that had been locked by a call to lock() or
try_lock().