mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 01:04:43 +01: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:
parent
933bfd4282
commit
73743ddbff
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue