const class concurrent::AtomicBool

sys::Obj
  concurrent::AtomicBool

@Js

Source

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

compareAndSet

Bool compareAndSet(Bool expect, Bool 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.

getAndSet

Bool getAndSet(Bool val)

Source

Atomically set the value and return the previous value.

make

new make(Bool val := false)

Source

Construct with initial value

toStr

virtual override Str toStr()

Source

Return val.toStr

val

Bool val

Source

The current boolean value