Package-level declarations

Types

Link copied to clipboard
expect class Atomic<V>(initialValue: V)

Atomic value of V.

actual class Atomic<V>(initialValue: V)
actual typealias Atomic<V> = AtomicReference<V>
actual class Atomic<V>(initialValue: V)
Link copied to clipboard
class AtomicBoolean(value: Boolean)
Link copied to clipboard
expect class AtomicInt(initialValue: Int)
actual class AtomicInt(initialValue: Int)
actual typealias AtomicInt = AtomicInteger
actual class AtomicInt(initialValue: Int)
Link copied to clipboard
expect class AtomicLong(initialValue: Long)
actual class AtomicLong(initialValue: Long)
actual class AtomicLong(initialValue: Long)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
inline fun AtomicBoolean.getAndUpdate(function: (Boolean) -> Boolean): Boolean
inline fun AtomicInt.getAndUpdate(function: (Int) -> Int): Int
inline fun AtomicLong.getAndUpdate(function: (Long) -> Long): Long
inline fun <V> Atomic<V>.getAndUpdate(function: (V) -> V): V

Updates variable atomically using the specified function of its value and returns its old value.

Link copied to clipboard
inline fun AtomicBoolean.loop(action: (Boolean) -> Unit): Nothing
inline fun AtomicInt.loop(action: (Int) -> Unit): Nothing
inline fun AtomicLong.loop(action: (Long) -> Unit): Nothing
inline fun <V> Atomic<V>.loop(action: (V) -> Unit): Nothing

Infinite loop that reads this atomic variable and performs the specified action on its value.

Link copied to clipboard
inline fun AtomicBoolean.tryUpdate(function: (Boolean) -> Boolean): Boolean
inline fun AtomicInt.tryUpdate(function: (Int) -> Int): Boolean
inline fun AtomicLong.tryUpdate(function: (Long) -> Long): Boolean
inline fun <V> Atomic<V>.tryUpdate(function: (V) -> V): Boolean
Link copied to clipboard
inline fun AtomicBoolean.update(function: (Boolean) -> Boolean)
inline fun AtomicInt.update(function: (Int) -> Int)
inline fun AtomicLong.update(function: (Long) -> Long)
inline fun <V> Atomic<V>.update(function: (V) -> V)
Link copied to clipboard
inline fun AtomicBoolean.updateAndGet(function: (Boolean) -> Boolean): Boolean
inline fun AtomicInt.updateAndGet(function: (Int) -> Int): Int
inline fun AtomicLong.updateAndGet(function: (Long) -> Long): Long
inline fun <V> Atomic<V>.updateAndGet(function: (V) -> V): V

Updates variable atomically using the specified function of its value and returns its new value.