permits

protected long permits

Current number of available permits.

Constructor Detail

Semaphore

public Semaphore(long initialPermits)

Create a Semaphore with the given initial number of permits. Using a
seed of one makes the semaphore act as a mutual exclusion lock. Negative
seeds are also allowed, in which case no acquires will proceed until the
number of releases has pushed the number of permits past 0.