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 {...@@ -111,7 +111,7 @@ pub const Node = struct {
111 /// Tell the parent node that this node is actively being worked on. Thread-safe.111 /// Tell the parent node that this node is actively being worked on. Thread-safe.
112 pub fn activate(self: *Node) void {112 pub fn activate(self: *Node) void {
113 if (self.parent) |parent| {113 if (self.parent) |parent| {
114 @atomicStore(?*Node, &parent.recently_updated_child, self, .Monotonic);114 @atomicStore(?*Node, &parent.recently_updated_child, self, .Release);
115 }115 }
116 }116 }
117117
...@@ -251,7 +251,7 @@ fn refreshWithHeldLock(self: *Progress) void {...@@ -251,7 +251,7 @@ fn refreshWithHeldLock(self: *Progress) void {
251 need_ellipse = false;251 need_ellipse = false;
252 }252 }
253 }253 }
254 maybe_node = @atomicLoad(?*Node, &node.recently_updated_child, .Monotonic);254 maybe_node = @atomicLoad(?*Node, &node.recently_updated_child, .Acquire);
255 }255 }
256 if (need_ellipse) {256 if (need_ellipse) {
257 self.bufWrite(&end, "... ", .{});257 self.bufWrite(&end, "... ", .{});