Ultra-low-level synchronization primitive based on Linux Futex and Windows WaitOnAddress. Allows threads to efficiently wait on a memory address until notified.

Static methods

@:has_untypedstaticwait(buffer:NativeBuffer, byteOffset:Int, expectedValue:Int):Bool

Blocks the current thread if the value at the given buffer location matches expectedValue.

Parameters:

buffer

The NativeBuffer containing the 32-bit integer.

byteOffset

Offset in bytes from the start of the buffer (must be 4-byte aligned).

expectedValue

The value that must be present to trigger the wait.

Returns:

True if the wait was successful (awoken or value already changed).

@:has_untypedstaticwake(buffer:NativeBuffer, byteOffset:Int):Int

Wakes a single thread waiting on the given buffer location.

@:has_untypedstaticwakeAll(buffer:NativeBuffer, byteOffset:Int):Int

Wakes all threads waiting on the given buffer location.