Java.Util.Concurrent.Semaphore: Method Members

The methods of Java.Util.Concurrent.Semaphore are listed below. For a list of all members, see the Semaphore Members list.

See Also: Inherited members from Java.Lang.Object

Public Methods

Acquire()
Acquires a permit from this semaphore, blocking until one is available, or the thread is Java.Lang.Thread.Interrupt.
Acquire(int)
Acquires the given number of permits from this semaphore, blocking until all are available, or the thread is Java.Lang.Thread.Interrupt.
AcquireUninterruptibly()
Acquires a permit from this semaphore, blocking until one is available.
AcquireUninterruptibly(int)
Acquires the given number of permits from this semaphore, blocking until all are available.
AvailablePermits() : int
Returns the current number of permits available in this semaphore.
DrainPermits() : int
Acquires and returns all permits that are immediately available.
Release()
Releases a permit, returning it to the semaphore.
Release(int)
Releases the given number of permits, returning them to the semaphore.
TryAcquire() : bool
Acquires a permit from this semaphore, only if one is available at the time of invocation.
TryAcquire(int) : bool
Acquires the given number of permits from this semaphore, only if all are available at the time of invocation.
TryAcquire(long, TimeUnit) : bool
Acquires a permit from this semaphore, if one becomes available within the given waiting time and the current thread has not been Java.Lang.Thread.Interrupt.
TryAcquire(int, long, TimeUnit) : bool
Acquires the given number of permits from this semaphore, if all become available within the given waiting time and the current thread has not been Java.Lang.Thread.Interrupt.

Protected Methods

ReducePermits(int)
Shrinks the number of available permits by the indicated reduction.