DoxigAlpha

wake

Unblocks at most max_waiters callers blocked in a wait() call on ptr.

Function parameters

Parameters

#
ptr:*const atomic.Value(u32)
max_waiters:u32

Deadline is used to wait efficiently for a pointer's value to change using Futex and a fixed timeout.

Types

#
Deadline
Deadline is used to wait efficiently for a pointer's value to change using Futex and a fixed timeout.

Checks if `ptr` still contains the value `expect` and, if so, blocks the caller until either:

Functions

#
wait
Checks if `ptr` still contains the value `expect` and, if so, blocks the caller until either:
timedWait
Checks if `ptr` still contains the value `expect` and, if so, blocks the caller until either:
wake
Unblocks at most `max_waiters` callers blocked in a `wait()` call on `ptr`.

Source

Implementation

#
pub fn wake(ptr: *const atomic.Value(u32), max_waiters: u32) void {
    @branchHint(.cold);

    // Avoid calling into the OS if there's nothing to wake up.
    if (max_waiters == 0) {
        return;
    }

    Impl.wake(ptr, max_waiters);
}