AtomicReference<T> class

An object reference that is always updated atomically.

Annotations

Constructors

AtomicReference(T value)
An object reference that is always updated atomically.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value ↔ T
getter/setter pair

Methods

compareAndExchange(T expectedValue, T newValue) → T
Atomically sets the value to the given newValue if the current value equals the expectedValue and returns the old value in any case.
compareAndSet(T expectedValue, T newValue) Boolean
Atomically sets the value to the given newValue if the current value equals the expectedValue, returns true if the operation was successful and false only if the current value was not equal to the expectedValue.
getAndSet(T newValue) → T
Atomically sets the value to the given newValue and returns the old value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns the string representation of the current value.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited