AtomicInt

expect class AtomicInt(initialValue: Int)(source)
actual class AtomicInt(initialValue: Int)(source)
actual typealias AtomicInt = AtomicInteger(source)
actual class AtomicInt(initialValue: Int)(source)

Constructors

Link copied to clipboard
expect constructor(initialValue: Int)
actual constructor(initialValue: Int)
actual constructor(initialValue: Int)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
expect fun addAndGet(delta: Int): Int
actual fun addAndGet(delta: Int): Int
actual fun addAndGet(delta: Int): Int
Link copied to clipboard
expect fun compareAndSet(expected: Int, new: Int): Boolean
actual fun compareAndSet(expected: Int, new: Int): Boolean
actual fun compareAndSet(expected: Int, new: Int): Boolean
Link copied to clipboard
expect fun decrementAndGet(): Int
actual fun decrementAndGet(): Int
actual fun decrementAndGet(): Int
Link copied to clipboard
expect fun get(): Int
actual fun get(): Int
actual fun get(): Int
Link copied to clipboard
expect fun getAndSet(value: Int): Int
actual fun getAndSet(value: Int): Int
actual fun getAndSet(value: Int): Int
Link copied to clipboard
inline fun AtomicInt.getAndUpdate(function: (Int) -> Int): Int

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

Link copied to clipboard
expect fun incrementAndGet(): Int
actual fun incrementAndGet(): Int
actual fun incrementAndGet(): Int
Link copied to clipboard
inline fun AtomicInt.loop(action: (Int) -> Unit): Nothing

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

Link copied to clipboard
expect fun set(newValue: Int)
actual fun set(newValue: Int)
actual fun set(newValue: Int)
Link copied to clipboard
inline fun AtomicInt.tryUpdate(function: (Int) -> Int): Boolean
Link copied to clipboard
inline fun AtomicInt.update(function: (Int) -> Int)
Link copied to clipboard
inline fun AtomicInt.updateAndGet(function: (Int) -> Int): Int

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