-
Notifications
You must be signed in to change notification settings - Fork 7
timed_named_mutex try_lock_until
Alairion edited this page May 8, 2021
·
2 revisions
nes::timed_named_mutex::try_lock_until
template<class Clock, class Duration>
(1) bool try_lock_until(const std::chrono::time_point<Clock, Duration>& time_point);
- Tries to lock the mutex. Blocks until specified time point is reached or the lock is acquired.
Name | Description |
---|---|
time_point |
A std::chrono::time_point representing the minimum time point to wait until |
- Returns
true
if the mutex was acquired,false
otherwise.
- The calling thread must not own the mutex.
- Throws a
std::runtime_error
if the lock operation fails.
- On Windows, calls
WaitForSingleObject
with a timeout equal to the conversion of the duration to milliseconds (rounded down) of the time point subtracted by the current time. On Posix systems, callspthread_mutex_timedlock