timed_mutex::try_lock_for Method
Attempts to obtain ownership of the mutex without blocking.
template<class Rep, class Period>
bool try_lock_for(const chrono::duration<Rep, Period>& Rel_time);
Parameters
- Rel_time
A chrono::duration object that specifies the maximum amount of time that the method attempts to obtain ownership of the mutex.
Return Value
true if the method successfully obtains ownership of the mutex; otherwise, false.
Remarks
If the calling thread already owns the mutex, the behavior is undefined.
Requirements
Header: mutex
Namespace: std