Semaphore.acquire

acquire resources from the semaphore.

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.

struct Semaphore
@safe @nogc
void
acquire

Parameters

amount size_t

the amount of resources to request.

timeout 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.

Meta