authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-05-13 14:31:19-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-05-13 14:31:30-07:00
logc30edd78f9ed65c5659f86a63a9b59a88838c618
treeb2ab9adfcd676f170fd6245086cb3f8d254e5211
parentb986fcfc996ec54e2f755b1161df1a6ceac009d4

std.Progress: activate() calls maybeRefresh()

This makes the progress bar display the ongoing operation in the case that the API user calls activate().

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

lib/std/Progress.zig+4-1
......@@ -93,7 +93,9 @@ pub const Node = struct {
9393
9494 /// This is the same as calling `start` and then `end` on the returned `Node`. Thread-safe.
9595 pub fn completeOne(self: *Node) void {
96 self.activate();
96 if (self.parent) |parent| {
97 @atomicStore(?*Node, &parent.recently_updated_child, self, .Release);
98 }
9799 _ = @atomicRmw(usize, &self.unprotected_completed_items, .Add, 1, .Monotonic);
98100 self.context.maybeRefresh();
99101 }
......@@ -120,6 +122,7 @@ pub const Node = struct {
120122 pub fn activate(self: *Node) void {
121123 if (self.parent) |parent| {
122124 @atomicStore(?*Node, &parent.recently_updated_child, self, .Release);
125 self.context.maybeRefresh();
123126 }
124127 }
125128