Showing content from https://cplusplus.com/reference/mutex/recursive_timed_mutex/try_lock_until/ below:
public member function
<mutex>
std::recursive_timed_mutex::try_lock_until
template <class Clock, class Duration> bool try_lock_until (const chrono::time_point<Clock,Duration>& abs_time);
Try to lock until time point
Attempts to lock the recursive_timed_mutex, blocking until abs_time at most:
All lock and unlock operations on the recursive_timed_mutex follow a single total order, with all visible effects synchronized between the lock operations and previous unlock operations on the same object.
Parameters
abs_time
A point in time at which the thread will stop blocking, abandoning the attempt to lock.
time_point is an object that represents a specific absolute time.
Return valuetrue
if the function succeeds in locking the recursive_timed_mutex for the thread.
false
otherwise.
Data races The recursive_timed_mutex object is accessed/modified as an atomic operation (causes no data races).
Exception safety Offers the same level of guarantee as the operations on the duration object (for the types used by the clocks in <chrono>, this is a no-throw guarantee).
See also
-
recursive_timed_mutex::lock
-
Lock recursive timed mutex (public member function)
-
recursive_timed_mutex::try_lock
-
Lock recursive timed mutex if not locked (public member function)
-
recursive_timed_mutex::try_lock_for
-
Try to lock for time span (public member function)
-
recursive_timed_mutex::unlock
-
Unlock timed mutex (public member function)
-
sleep_until
-
Sleep until time point (function)
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4