commit d70bd0b37eafb82e3020f163ebcbaa2c13791e75 (tree)
parent 2370dc886cf4bc919d912ea3c0a564f71675fd2e
Author: GasInfinity <me@gasinfinity.dev>
Date: Tue, 10 Mar 2026 19:46:56 +0100
fix: use `cmpxchgStrong` in `std.atomic.Mutex`
* same reason as 048e38624e1b7c1ad140e253f1e5e7c868658089
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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 {