AtomicArray<T> class

An Array in which elements are always updated atomically.

For additional details about atomicity guarantees for reads and writes see Volatile.

Annotations

Constructors

AtomicArray()

Properties

hashCode int
The hash code for this object.
no setterinherited
length Int
Returns the number of elements in the array.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

compareAndExchange(Int index, T expectedValue, T newValue) → T
Atomically sets the value of the element at the given index to the newValue if the current value equals the expectedValue and returns the old value of the element in any case.
compareAndSet(Int index, T expectedValue, T newValue) Boolean
Atomically sets the value of the element at the given index to the newValue if the current value equals the expectedValue.
getAndSet(Int index, T newValue) → T
Atomically sets the value of the element at the given index to the newValue and returns the old value of the element.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns the string representation of the underlying IntArray.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](Int index) → dynamic
Atomically gets the value of the element at the given index.
operator []=(Int index, T newValue) → void
Atomically sets the value of the element at the given index to the newValue.