February 2012
Intermediate to advanced
528 pages
17h 47m
English
Attempts to acquire a lock on a std::recursive_timed_mutex object for the current thread.
Declaration
template<typename Rep,typename Period>
bool try_lock_for(
std::chrono::duration<Rep,Period> const& relative_time);
Effects
Attempts to acquire a lock on *this for the calling thread within the time specified by relative_time. If relative_time.count() is zero or negative, the call will return immediately, as if it was a call to try_lock(). Otherwise, the call blocks until either the lock has been acquired or the time period specified by relative_time has elapsed.
Returns
true if a lock was obtained for the calling thread, false otherwise.
Postconditions
*this is locked by the calling ...
Read now
Unlock full access