AtomicBoolean

Constructors

Link copied to clipboard
constructor(value: Boolean)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun compareAndSet(expected: Boolean, new: Boolean): Boolean
Link copied to clipboard
fun get(): Boolean
Link copied to clipboard
Link copied to clipboard
inline fun AtomicBoolean.getAndUpdate(function: (Boolean) -> Boolean): Boolean

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

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

Link copied to clipboard
fun set(value: Boolean)
Link copied to clipboard
inline fun AtomicBoolean.tryUpdate(function: (Boolean) -> Boolean): Boolean
Link copied to clipboard
inline fun AtomicBoolean.update(function: (Boolean) -> Boolean)
Link copied to clipboard
inline fun AtomicBoolean.updateAndGet(function: (Boolean) -> Boolean): Boolean

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