cpp/thread/unique lock/try lock for

Tries to lock (i.e., takes ownership of) the associated mutex. Blocks until specified has elapsed or the lock is acquired, whichever comes first. On successful lock acquisition returns, otherwise returns. Effectively calls.

This function may block for longer than due to scheduling or resource contention delays.

The standard recommends that a steady clock is used to measure the duration. If an implementation uses a system clock instead, the wait time may also be sensitive to clock adjustments.

std is thrown if there is no associated mutex or if the mutex is already locked by this std::unique_lock.

Return value
if the ownership of the mutex has been acquired successfully, otherwise.

Exceptions

 * Any exceptions thrown by


 * If there is no associated mutex, std with an error code of std


 * If the mutex is already locked, std with an error code of std