Struct Semaphore

Reactor aware semaphore

struct Semaphore ;

Constructors

NameDescription
this Construct a semaphore with given capacity.

Properties

NameTypeDescription
capacity[get] ulongReport the capacity of the semaphore
level[get] ulongReport the current amount of available resources.

Methods

NameDescription
acquire acquire resources from the semaphore.
close Call this function when the semaphore is no longer needed.
open Call this function before using the semaphore.
release Release resources acquired via acquire.
setCapacity Change the capacity of the semaphore
tryAcquire Try to acquire resources from the semaphore.