AtomicInt

interface AtomicInt(source)

Atomic Int.

Author

ForteScarlet

Properties

Link copied to clipboard
abstract var value: Int

Functions

Link copied to clipboard
abstract fun compareAndExchange(expect: Int, value: Int): Int
Link copied to clipboard
abstract fun compareAndSet(expect: Int, value: Int): Boolean
Link copied to clipboard
abstract fun decrementAndGet(delta: Int = 1): Int
Link copied to clipboard
abstract fun getAndDecrement(delta: Int = 1): Int
Link copied to clipboard
abstract fun getAndIncrement(delta: Int = 1): Int
Link copied to clipboard
abstract fun getAndSet(value: Int): Int
Link copied to clipboard
abstract fun incrementAndGet(delta: Int = 1): Int

Inherited functions

Link copied to clipboard
operator fun AtomicInt.minusAssign(delta: Int)

Operator -= for AtomicInt.

Link copied to clipboard
operator fun AtomicInt.plusAssign(delta: Int)

Operator += for AtomicInt.

Link copied to clipboard
inline fun AtomicInt.update(block: (Int) -> Int): Int

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

Link copied to clipboard
inline fun AtomicInt.updateAndGet(block: (Int) -> Int): Int

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