Skip to content

semaphore try_acquire

Alairion edited this page May 8, 2021 · 4 revisions

nes::semaphore::try_acquire

Functions

(1) bool try_acquire();
  1. Checks if a resource is available, and if that is the case decrements the resource counter.

Parameters

None.

Return value

  1. Returns true if a resource was successfully acquired, otherwise returns false.

Exceptions

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

Implementation details

  1. On Windows, calls WaitForSingleObject with a timeout of 0ms
    On Posix systems, calls sem_trywait
Clone this wiki locally