AtomicInt

Native
1.3
class AtomicInt

Atomic values and freezing: atomics AtomicInt, AtomicLong, AtomicNativePtr and AtomicReference are unique types with regard to freezing. Namely, they provide mutating operations, while can participate in frozen subgraphs. So shared frozen objects can have fields of atomic types.

Constructors

Native
1.3

<init>

Atomic values and freezing: atomics AtomicInt, AtomicLong, AtomicNativePtr and AtomicReference are unique types with regard to freezing. Namely, they provide mutating operations, while can participate in frozen subgraphs. So shared frozen objects can have fields of atomic types.

AtomicInt(value_: Int)

Properties

Native
1.3

value

The value being held by this class.

var value: Int

Functions

Native
1.3

addAndGet

Increments the value by delta and returns the new value.

fun addAndGet(delta: Int): Int
Native
1.3

compareAndSet

Compares value with expected and replaces it with new value if values matches.

fun compareAndSet(expected: Int, new: Int): Boolean
Native
1.3

compareAndSwap

Compares value with expected and replaces it with new value if values matches.

fun compareAndSwap(expected: Int, new: Int): Int
Native
1.3

decrement

Decrements value by one.

fun decrement()
Native
1.3

increment

Increments value by one.

fun increment()
Native
1.3

toString

Returns the string representation of this object.

fun toString(): String