AtomicLong

expect class AtomicLong(initialValue: Long)(source)
actual class AtomicLong(initialValue: Long)(source)
actual class AtomicLong(initialValue: Long)(source)

Constructors

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

Properties

Link copied to clipboard

Functions

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

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

Link copied to clipboard
expect fun incrementAndGet(): Long
actual fun incrementAndGet(): Long
actual fun incrementAndGet(): Long
Link copied to clipboard
inline fun AtomicLong.loop(action: (Long) -> 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: Long)
actual fun set(newValue: Long)
actual fun set(newValue: Long)
Link copied to clipboard
inline fun AtomicLong.tryUpdate(function: (Long) -> Long): Boolean
Link copied to clipboard
inline fun AtomicLong.update(function: (Long) -> Long)
Link copied to clipboard
inline fun AtomicLong.updateAndGet(function: (Long) -> Long): Long

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