Skip to content

timed_semaphore try_acquire_until

Alairion edited this page May 8, 2021 · 6 revisions

nes::timed_semaphore::try_acquire_until

Functions

    template<typename Clock, typename Duration>
(1) bool try_acquire_until(const std::chrono::time_point<Clock, Duration>& time_point);
  1. Checks if a resource is available until a specified time point, and if that is the case decrements the resource counter.

Note: The implementation may not take care of Clock adjustment.

Parameters

Name Description
time_point The maximum time point to wait until

Return value

  1. Returns true if the resource counter was successfully decremented, returns false otherwise.

Exceptions

  1. May throw an exception depending on the implementation behaviour.

Implementation details

  1. On Windows, calls WaitForSingleObject
    On Posix systems, calls sem_timedwait
Clone this wiki locally