AtomicReference
Constructors
<init>
An object reference that is always updated atomically.
AtomicReference
(
value
:
T
)
Properties
value
var
value
:
T
Functions
compareAndExchange
Atomically sets the value to the given new value if the current value equals the expected value and returns the old value in any case.
fun
compareAndExchange
(
expected
:
T
,
newValue
:
T
)
:
T
compareAndSet
Atomically sets the value to the given new value if the current value equals the expected value , returns true if the operation was successful and false only if the current value was not equal to the expected value.
fun
compareAndSet
(
expected
:
T
,
newValue
:
T
)
:
Boolean