Function Semaphore.acquire

acquire resources from the semaphore.

void acquire (
  ulong amount = 1LU,
  Timeout timeout = Timeout(TscTimePoint(9223372036854775807L))
) @nogc @safe;

Acquire one or more "resources" from the semaphore. Sleep if not enough are available. The semaphore guarantees a strict FIFO. A new request, even if satifiable, will not be granted until all older requests are granted.

Parameters

NameDescription
amount the amount of resources to request.
timeout how long to wait for resources to become available.

Throws

TimeoutExpired if timeout has elapsed without satisfying the request.

Also, any other exception may be thrown if injected using theReactor.throwInFiber.