mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
std.Progress: fix atomic ordering semantics
thx king protty
This commit is contained in:
parent
4e621d4260
commit
fbcffe9d5d
@ -111,7 +111,7 @@ pub const Node = struct {
|
||||
/// Tell the parent node that this node is actively being worked on. Thread-safe.
|
||||
pub fn activate(self: *Node) void {
|
||||
if (self.parent) |parent| {
|
||||
@atomicStore(?*Node, &parent.recently_updated_child, self, .Monotonic);
|
||||
@atomicStore(?*Node, &parent.recently_updated_child, self, .Release);
|
||||
}
|
||||
}
|
||||
|
||||
@ -251,7 +251,7 @@ fn refreshWithHeldLock(self: *Progress) void {
|
||||
need_ellipse = false;
|
||||
}
|
||||
}
|
||||
maybe_node = @atomicLoad(?*Node, &node.recently_updated_child, .Monotonic);
|
||||
maybe_node = @atomicLoad(?*Node, &node.recently_updated_child, .Acquire);
|
||||
}
|
||||
if (need_ellipse) {
|
||||
self.bufWrite(&end, "... ", .{});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user