Function wait [src]
Checks if ptr still contains the value expect and, if so, blocks the caller until either:
The value at ptr is no longer equal to expect.
The caller is unblocked by a matching wake().
The caller is unblocked spuriously ("at random").
The checking of ptr and expect, along with blocking the caller, is done atomically
and totally ordered (sequentially consistent) with respect to other wait()/wake() calls on the same ptr.
Prototype
pub fn wait(ptr: *const atomic.Value(u32), expect: u32) void
Parameters
ptr: *const atomic.Value(u32)
expect: u32
Source
pub fn wait(ptr: *const atomic.Value(u32), expect: u32) void {
@branchHint(.cold);
Impl.wait(ptr, expect, null) catch |err| switch (err) {
error.Timeout => unreachable, // null timeout meant to wait forever
};
}