Java.Util.Concurrent.Semaphore.Release Method
Releases the given number of permits, returning them to the semaphore.

Syntax

[Android.Runtime.Register("release", "(I)V", "GetRelease_IHandler")]
public virtual void Release (int permits)

Parameters

permits
the number of permits to release

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionif permits is negative

Remarks

Releases the given number of permits, returning them to the semaphore.

Releases the given number of permits, increasing the number of available permits by that amount. If any threads are trying to acquire permits, then one is selected and given the permits that were just released. If the number of available permits satisfies that thread's request then that thread is (re)enabled for thread scheduling purposes; otherwise the thread will wait until sufficient permits are available. If there are still permits available after this thread's request has been satisfied, then those permits are assigned in turn to other threads trying to acquire permits.

There is no requirement that a thread that releases a permit must have acquired that permit by calling Semaphore.Acquire. Correct usage of a semaphore is established by programming convention in the application.

[Android Documentation]

Requirements

Namespace: Java.Util.Concurrent
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1