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
newValueif the current value equals theexpectedValueand returns the old value in any case. -
compareAndSet(
T expectedValue, T newValue) → Boolean -
Atomically sets the value to the given
newValueif the current value equals theexpectedValue, returnstrueif the operation was successful andfalseonly if the current value was not equal to theexpectedValue. -
getAndSet(
T newValue) → T -
Atomically sets the value to the given
newValueand 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