pub fn futexWait(io: Io, comptime T: type, ptr: *align(@alignOf(u32)) const T, expected: T) Cancelable!void io: IoT: typeptr: *align(@alignOf(u32)) const Texpected: TCanceledCaller has requested the async operation to stop.
1675
1676
1677pub fn futexWait(io: Io, comptime T: type, ptr: *align(@alignOf(u32)) const T, expected: T) Cancelable!void {
return futexWaitTimeout(io, T, ptr, expected, .none);
}
Atomically checks if the value at
ptrequalsexpected, and if so, blocks until either:ptrargument)futexWakecall occurs, orTypically,
futexWakeshould be called immediately after updating the value atptr.*, to unblock tasks usingfutexWaitto 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
Tis 4 bytes in length and has a well-defined layout with no padding bits.