mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
std.atomic.Mutex: use unordered atomic load on assert
This silences a tsan race warning and gets optimized away in `ReleaseFast`.
This commit is contained in:
+1
-1
@@ -513,7 +513,7 @@ pub const Mutex = enum(u8) {
|
||||
}
|
||||
|
||||
pub fn unlock(m: *Mutex) void {
|
||||
assert(m.* == .locked);
|
||||
assert(@atomicLoad(Mutex, m, .unordered) == .locked);
|
||||
@atomicStore(Mutex, m, .unlocked, .release);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user