Condividi tramite


Semaphore Constructors

Definition

Overloads

Semaphore(Int32)

Creates a Semaphore with the given number of permits and nonfair fairness setting.

Semaphore(Int32, Boolean)

Creates a Semaphore with the given number of permits and the given fairness setting.

Semaphore(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Semaphore(Int32)

Creates a Semaphore with the given number of permits and nonfair fairness setting.

[Android.Runtime.Register(".ctor", "(I)V", "")]
public Semaphore (int permits);
[<Android.Runtime.Register(".ctor", "(I)V", "")>]
new Java.Util.Concurrent.Semaphore : int -> Java.Util.Concurrent.Semaphore

Parameters

permits
Int32

the initial number of permits available. This value may be negative, in which case releases must occur before any acquires will be granted.

Attributes

Remarks

Creates a Semaphore with the given number of permits and nonfair fairness setting.

Java documentation for java.util.concurrent.Semaphore.Semaphore(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Semaphore(Int32, Boolean)

Creates a Semaphore with the given number of permits and the given fairness setting.

[Android.Runtime.Register(".ctor", "(IZ)V", "")]
public Semaphore (int permits, bool fair);
[<Android.Runtime.Register(".ctor", "(IZ)V", "")>]
new Java.Util.Concurrent.Semaphore : int * bool -> Java.Util.Concurrent.Semaphore

Parameters

permits
Int32

the initial number of permits available. This value may be negative, in which case releases must occur before any acquires will be granted.

fair
Boolean

true if this semaphore will guarantee first-in first-out granting of permits under contention, else false

Attributes

Remarks

Creates a Semaphore with the given number of permits and the given fairness setting.

Java documentation for java.util.concurrent.Semaphore.Semaphore(int, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Semaphore(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

protected Semaphore (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Java.Util.Concurrent.Semaphore : nativeint * Android.Runtime.JniHandleOwnership -> Java.Util.Concurrent.Semaphore

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to