cpp/thread/try lock

Tries to lock each of the given objects, , ,  by calling  in order beginning with the first.

If a call to fails, no further call to  is performed,  is called for any locked objects and a -based index of the object that failed to lock is returned.

If a call to results in an exception,  is called for any locked objects before rethrowing.

Return value
on success, or -based index value of the object that failed to lock.