Showing content from https://cplusplus.com/reference/mutex/unique_lock/try_lock_until/ below:
public member function
<mutex>
std::unique_lock::try_lock_until
template <class Clock, class Duration> bool try_lock_until (const chrono::time_point<Clock,Duration>& abs_time);
Try to lock mutex until time point
Calls member try_lock_until of the managed timed mutex object, and uses the returned value to set the owning state.
If the owning state is already true
before the call, or if the object currently manages no mutex object, the function throws a system_error exception.
Parameters
abs_time
A point in time at which the thread will stop blocking, renouncing to acquire a lock.
time_point is an object that represents a specific absolute time.
Return valuetrue
if the function succeeds in locking the managed timed mutex object.
false
otherwise.
Data races The unique_lock object is accessed/modified.
The managed timed mutex object is accessed/modified as an atomic operation (causing no data races).
Exception safetyBasic guarantee: if an exception is thrown by this member function, the unique_lock object is left in a valid state.
If the call fails, a system_error exception is thrown:
An exception is also thrown if the call to try_lock_until on the managed timed mutex object fails, and on any other condition reported with such mechanism by the library implementation.
See also
-
unique_lock::lock
-
Lock mutex (public member function)
-
unique_lock::try_lock
-
Lock mutex if not locked (public member function)
-
unique_lock::try_lock_for
-
Try to lock mutex during time span (public member function)
-
unique_lock::unlock
-
Unlock mutex (public member 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