authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-12-19 16:12:33-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-12-20 15:08:59-07:00
logfbcffe9d5de64c792add092be2af317345a151f6
tree2b99887269ba41b9367d609e3e426e42f6f1b309
parent4e621d4260ed752995dedc50a240931fc0e0941f

std.Progress: fix atomic ordering semantics

thx king protty

1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/Progress.zig+2-2
......@@ -111,7 +111,7 @@ pub const Node = struct {
111111 /// Tell the parent node that this node is actively being worked on. Thread-safe.
112112 pub fn activate(self: *Node) void {
113113 if (self.parent) |parent| {
114 @atomicStore(?*Node, &parent.recently_updated_child, self, .Monotonic);
114 @atomicStore(?*Node, &parent.recently_updated_child, self, .Release);
115115 }
116116 }
117117
......@@ -251,7 +251,7 @@ fn refreshWithHeldLock(self: *Progress) void {
251251 need_ellipse = false;
252252 }
253253 }
254 maybe_node = @atomicLoad(?*Node, &node.recently_updated_child, .Monotonic);
254 maybe_node = @atomicLoad(?*Node, &node.recently_updated_child, .Acquire);
255255 }
256256 if (need_ellipse) {
257257 self.bufWrite(&end, "... ", .{});