package jdk
- Alphabetic
- Public
- All
Type Members
-
class
BooleanSemaphore
extends CountingSemaphore
A classical boolean semaphore that manages a single virtual permit.
A classical boolean semaphore that manages a single virtual permit. Each
acquire
waits if necessary until the permit is available, and then makes it unavailable (its "owner" is said to be the process that last made it unavailable). Arelease
makes the permit available (if it wasn't already) to a waiting process.If the semaphore is
fair
the semaphore will (under contention) guarantee first-in first-out acquisition of the permit. Fairness can impose very considerable delays.A thread that
release
s the permit need not have acquired it previously.This implementation delegates most of its implementation to
java.util.concurrent.Semaphore
.A
BooleanSemaphore
can be registered with the debugger.- Deprecated
Use io.threadcso.semaphore.CountingSemaphore instead unless you absolutely need the fairness parameter.
-
class
CountingSemaphore
extends debug.REGISTRY.Debuggable with Semaphore
A counting semaphore which maintains a virtual/conceptual set of permits.
A counting semaphore which maintains a virtual/conceptual set of permits. Each
acquire
waits if necessary until a permit is available, and then removes it from the set. Eachrelease
adds a permit, potentially causing a waitingacquire
to return.If the semaphore is
fair
the semaphore will (under contention) guarantee first-in first-out acquisition of permits (by default it is not fair). Fairness can impose considerable delays.No actual permit objects are involved; the semaphore just keeps a count of the number
available
, which may initially be negative.A thread that
release
s a permit need not have acquired one previously.This implementation delegates to
java.util.concurrent.Semaphore
.A
CountingSemaphore
can be registered with the debugger.- Deprecated
Use io.threadcso.semaphore.CountingSemaphore instead unless you absolutely need the fairness parameter.
Value Members
- object BooleanSemaphore extends NameGenerator
- object CountingSemaphore extends NameGenerator