Android Guides | Samples

Java.Util.Concurrent.Atomic.AtomicBoolean Class

A boolean value that may be updated atomically.

See Also: AtomicBoolean

Syntax

[Android.Runtime.Register("java/util/concurrent/atomic/AtomicBoolean", DoNotGenerateAcw=true)]
public class AtomicBoolean : Object, ISerializable, IDisposable

Remarks

A boolean value that may be updated atomically. See the Java.Util.Concurrent.Atomic package specification for description of the properties of atomic variables. An AtomicBoolean is used in applications such as atomically updated flags, and cannot be used as a replacement for a Boolean.

[Android Documentation]

Requirements

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

The members of Java.Util.Concurrent.Atomic.AtomicBoolean are listed below.

See Also: Object

Public Constructors

Creates a new AtomicBoolean with initial value false.
Creates a new AtomicBoolean with the given initial value.

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

CompareAndSet(Boolean, Boolean) : Boolean
Atomically sets the value to the given updated value if the current value == the expected value.
Get() : Boolean
Returns the current value.
GetAndSet(Boolean) : Boolean
Atomically sets to the given value and returns the previous value.
LazySet(Boolean)
Eventually sets to the given value.
Set(Boolean)
Unconditionally sets to the given value.
WeakCompareAndSet(Boolean, Boolean) : Boolean
Atomically sets the value to the given updated value if the current value == the expected value.