AtomicRef

interface AtomicRef<T>(source)

Atomic reference

Properties

Link copied to clipboard
abstract var value: T

Functions

Link copied to clipboard
abstract fun compareAndExchange(expect: T, value: T): T
Link copied to clipboard
abstract fun compareAndSet(expect: T, value: T): Boolean
Link copied to clipboard
abstract fun getAndSet(value: T): T

Inherited functions

Link copied to clipboard
inline fun <T> AtomicRef<T>.update(block: (T) -> T): T

Update value by AtomicRef.compareAndSet and then return the old value.

Link copied to clipboard
inline fun <T> AtomicRef<T>.updateAndGet(block: (T) -> T): T

Update value by AtomicRef.compareAndSet and then return the new value.