Function Semaphore.tryAcquire

Try to acquire resources from the semaphore.

bool tryAcquire (
  ulong amount = 1LU
) nothrow @nogc @safe;

Try to acquire one or more "resources" from the semaphore. To maintain strict FIFO, the acquire will fail if another request is currently pending, even if there are enough resources to satisfy both requests.

returns

Returns true if the request was granted.