Skip to documentation
SLOP

tiny.simd.SpinMonitorX

Reference tiny.simd SpinMonitorX

Defined in thread.spin.

API (3)

Actions

Public operations.

No direct callersNo direct callsthread.spinSpinMonitorX
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/simd/src/thread/spin.zig:52

zig
pub const SpinMonitorX = struct {    pub fn spinType(_: SpinMonitorX) SpinType {        return .monitor_x;    }    pub fn untilDifferent(        _: SpinMonitorX,        previous: u32,        watched: *const std.atomic.Value(u32),    ) SpinResult {        if (comptime !haveMonitorX()) {            return (SpinPause{}).untilDifferent(previous, watched);        }        var repetitions: u32 = 0;        while (true) : (repetitions +%= 1) {            var current = watched.load(.acquire);            if (current != previous) {                return .{                    .value = current,                    .repetitions = repetitions,                };            }            monitorX(&watched.raw);            current = watched.load(.acquire);            if (current != previous) {                return .{                    .value = current,                    .repetitions = repetitions,                };            }            waitX();        }    }    pub fn untilEqual(        _: SpinMonitorX,        expected: u32,        watched: *const std.atomic.Value(u32),    ) usize {        if (comptime !haveMonitorX()) {            return (SpinPause{}).untilEqual(expected, watched);        }        var repetitions: usize = 0;        while (true) : (repetitions +%= 1) {            var current = watched.load(.acquire);            if (current == expected) return repetitions;            monitorX(&watched.raw);            current = watched.load(.acquire);            if (current == expected) return repetitions;            waitX();        }    }};

Source: lib/simd/src/root.zig:122

zig
pub const SpinMonitorX = thread.SpinMonitorX;
Called byCallsNo direct callersprivate sourcelib.simd.src.thread.spinhaveMonitorXprivate sourcelib.simd.src.thread.spinmonitorXprivate sourcelib.simd.src.thread.spinwaitXSpinMonitorXuntilDifferent
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callersprivate sourcelib.simd.src.thread.spinhaveMonitorXprivate sourcelib.simd.src.thread.spinmonitorXprivate sourcelib.simd.src.thread.spinwaitXSpinMonitorXuntilEqual
Static calls · unresolved targets: 0 · external targets: 1.

Also reachable as

thread.SpinMonitorX.

Audit

Definitions4
Public names12
Members0
Version26.7.0
Revisiondaab053ee433