hxn

AtomicBool

A boolean flag shared by a native library and Haxe. Either side reads and writes it from any thread without a native call. It is an AtomicInt that holds 0 or 1, and is typically used to cancel a call in progress.

Constructor

function new(?value:Bool = false)

Static methods

function over(cell:AtomicInt):AtomicBool

Wraps cell as a flag.

Properties

var pointer(get, null):Ref<Int>

The pointer a binding passes to a native call that has the flag as a parameter.

var load(default, null):() -> Bool
var store(default, null):(value:Bool) -> Bool

Sets the flag and returns the new value.

var exchange(default, null):(value:Bool) -> Bool

Sets the flag and returns the previous value.

var compareExchange(default, null):(expected:Bool, replacement:Bool) -> Bool

Sets the flag if it equals expected. Returns the previous value in both cases.