class

AtomicBool

@Js
const class AtomicBool : Obj

AtomicBool is used to manage a boolean variable shared between actor/threads with atomic updates.

constructors make

Construct with initial value

fields val

The current boolean value

methods toStr

Return val.toStr

compareAndSet

Atomically set the value to update if current value is equivalent to the expect value

getAndSet

Atomically set the value and return the previous value

compareAndSet Bool compareAndSet(Bool expect, Bool update)

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.

getAndSet Bool getAndSet(Bool val)

Atomically set the value and return the previous value.

make new make(Bool val)

Construct with initial value

toStr virtual Str toStr()

Return val.toStr

val Bool : val

The current boolean value

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST