The members of Java.Util.Concurrent.Semaphore are listed below.
See Also: Inherited members from Java.Lang.Object
Public Constructors
| | Creates a Semaphore with the given number of
permits and nonfair fairness setting. |
| | Creates a Semaphore with the given number of
permits and the given fairness setting. |
Protected Constructors
| | A constructor used when creating managed representations of JNI objects; called by the runtime. |
Public Properties
[read-only] | HasQueuedThreads | bool. Queries whether any threads are waiting to acquire. |
[read-only] | IsFair | bool. Returns true if this semaphore has fairness set true. |
[read-only] | QueueLength | int. Returns an estimate of the number of threads waiting to acquire. |
Protected Properties
[read-only] | QueuedThreads | ICollection<Java.Lang.Thread>. Returns a collection containing threads that may be waiting to acquire. |
[read-only] override | ThresholdClass | IntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
[read-only] override | ThresholdType | Type. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
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() : intReturns the current number of permits available in this semaphore. |
| DrainPermits() : intAcquires 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() : boolAcquires a permit from this semaphore, only if one is available at the
time of invocation. |
| TryAcquire(int) : boolAcquires the given number of permits from this semaphore, only
if all are available at the time of invocation. |
| TryAcquire(long, TimeUnit) : boolAcquires 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) : boolAcquires 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. |