Android Guides | Samples

Android.OS.ConditionVariable Class

Class that implements the condition variable locking paradigm.

See Also: ConditionVariable

Syntax

[Android.Runtime.Register("android/os/ConditionVariable", DoNotGenerateAcw=true)]
public class ConditionVariable : Object

Remarks

Class that implements the condition variable locking paradigm.

This differs from the built-in java.lang.Object wait() and notify() in that this class contains the condition to wait on itself. That means open(), close() and block() are sticky. If open() is called before block(), block() will not block, and instead return immediately.

This class uses itself as the object to wait on, so if you wait() or notify() on a ConditionVariable, the results are undefined.

[Android Documentation]

Requirements

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

The members of Android.OS.ConditionVariable are listed below.

See Also: Object

Public Constructors

Create the ConditionVariable in the default closed state.
Create the ConditionVariable with the given state.

Protected Constructors

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

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

Block()
Block the current thread until the condition is opened.
Block(Int64) : Boolean
Block the current thread until the condition is opened or until timeout milliseconds have passed.
Close()
Reset the condition to the closed state.
Open()
Open the condition, and release all threads that are blocked.