diff --git a/lib/std/Io.zig b/lib/std/Io.zig index 87f342f640316343440e5f93e2c1924b81a51c6e..8d51f649e3e79180860e02c2e4930e975cce7e33 100644 --- a/lib/std/Io.zig +++ b/lib/std/Io.zig @@ -1577,11 +1577,11 @@ pub const Mutex = extern struct { }; pub fn tryLock(m: *Mutex) bool { - return m.state.cmpxchgWeak(.unlocked, .locked_once, .acquire, .monotonic) == null; + return m.state.cmpxchgStrong(.unlocked, .locked_once, .acquire, .monotonic) == null; } pub fn lock(m: *Mutex, io: Io) Cancelable!void { - const initial_state = m.state.cmpxchgWeak( + const initial_state = m.state.cmpxchgStrong( .unlocked, .locked_once, .acquire, @@ -1602,7 +1602,7 @@ pub const Mutex = extern struct { /// /// For a description of cancelation and cancelation points, see `Future.cancel`. pub fn lockUncancelable(m: *Mutex, io: Io) void { - const initial_state = m.state.cmpxchgWeak( + const initial_state = m.state.cmpxchgStrong( .unlocked, .locked_once, .acquire, diff --git a/lib/std/Io/RwLock.zig b/lib/std/Io/RwLock.zig index 586a94af034d50ed0d632f97abaa29ff29b280b5..7be4f026e16c150feef443286315567add6bf69c 100644 --- a/lib/std/Io/RwLock.zig +++ b/lib/std/Io/RwLock.zig @@ -114,8 +114,6 @@ test "internal state" { } test "smoke test" { - if (builtin.target.cpu.arch.isAARCH64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/31393 - const io = testing.io; var rl: Io.RwLock = .init; diff --git a/lib/std/atomic.zig b/lib/std/atomic.zig index 0040dbf735eeaabad5c5d532663757bfb5de5491..89f22a89ccc72b1a962a5f781a7c9692b6174a6c 100644 --- a/lib/std/atomic.zig +++ b/lib/std/atomic.zig @@ -509,7 +509,7 @@ pub const Mutex = enum(u8) { locked, pub fn tryLock(m: *Mutex) bool { - return @cmpxchgWeak(Mutex, m, .unlocked, .locked, .acquire, .monotonic) == null; + return @cmpxchgStrong(Mutex, m, .unlocked, .locked, .acquire, .monotonic) == null; } pub fn unlock(m: *Mutex) void {