commit fbcffe9d5de64c792add092be2af317345a151f6 (tree)
parent 4e621d4260ed752995dedc50a240931fc0e0941f
Author: Andrew Kelley <andrew@ziglang.org>
Date: Sat, 19 Dec 2020 16:12:33 -0700
std.Progress: fix atomic ordering semantics
thx king protty
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/std/Progress.zig b/lib/std/Progress.zig
@@ -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, "... ", .{});