AtomicReference

Native
1.3
class AtomicReference<T>
(source)
Deprecated: Use kotlin.concurrent.AtomicReference instead.

An object reference that is always updated atomically.

Constructors

Native
1.3

<init>

An object reference that is always updated atomically.

AtomicReference(value: T)

Properties

Native
1.3

value

var value: T

Functions

Native
1.3

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
Native
1.3

compareAndSwap

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 compareAndSwap(expected: T, newValue: T): T
Native
1.3

getAndSet

Atomically sets the value to the given new value and returns the old value.

fun getAndSet(newValue: T): T
Native
1.3

toString

Returns the string representation of this object.

fun toString(): String