const class concurrent::AtomicInt

sys::Obj
  concurrent::AtomicInt

Source

AtomicInt is used to manage an integer variable shared between actor/threads with atomic updates.

addAndGet

Int addAndGet(Int delta)

Source

Atomically add the given value to the current value and return the updated value.

compareAndSet

Bool compareAndSet(Int expect, Int update)

Source

Atomically set the value to update if current value is equivalent to the expect value. Return true if updated, or false if current value was not equal to the expected value.

decrementAndGet

Int decrementAndGet()

Source

Atomically increment the current value by one and return the updated value.

getAndAdd

Int getAndAdd(Int delta)

Source

Atomically add the given value to the current value and return the previous value.

getAndDecrement

Int getAndDecrement()

Source

Atomically decrement the current value by one and return the previous value.

getAndIncrement

Int getAndIncrement()

Source

Atomically increment the current value by one and return the previous value.

getAndSet

Int getAndSet(Int val)

Source

Atomically set the value and return the previous value.

incrementAndGet

Int incrementAndGet()

Source

Atomically increment the current value by one and return the updated value.

make

new make(Int val := 0)

Source

Construct with initial value

toStr

virtual override Str toStr()

Source

Return val.toStr

val

Int val

Source

The current integer value