Semaphore

Reactor aware semaphore

Constructors

this
this(size_t capacity, size_t used)

Construct a semaphore with given capacity.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

acquire
void acquire(size_t amount, Timeout timeout)

acquire resources from the semaphore.

close
void close()

Call this function when the semaphore is no longer needed.

open
void open(size_t capacity, size_t used)

Call this function before using the semaphore.

release
void release(size_t amount)

Release resources acquired via acquire.

setCapacity
void setCapacity(size_t newCapacity, bool immediate)

Change the capacity of the semaphore

tryAcquire
bool tryAcquire(size_t amount)

Try to acquire resources from the semaphore.

Properties

capacity
size_t capacity [@property getter]

Report the capacity of the semaphore

level
size_t level [@property getter]

Report the current amount of available resources.

Meta