Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

futexWait

Atomically checks if the value at ptr equals expected, and if so, blocks until either:

Typically, futexWake should be called immediately after updating the value at ptr.*, to unblock tasks using futexWait to wait for the value to change from what it previously was.

The caller is responsible for identifying spurious wakeups if necessary, typically by checking the value at ptr.*.

Asserts that T is 4 bytes in length and has a well-defined layout with no padding bits.

Io.futexWait
pub fn futexWait(io: Io, comptime T: type, ptr: *align(@alignOf(u32)) const T, expected: T) Cancelable!void

File

lib/std/Io.zig:1578

Code

pub fn futexWait(io: Io, comptime T: type, ptr: *align(@alignOf(u32)) const T, expected: T) Cancelable!void {
    return futexWaitTimeout(io, T, ptr, expected, .none);
}