aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-12-18 21:51:18 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-12-20 15:08:59 -0700
commitaa6ef10cc657e2bbe59c362f27d7a557c43d7fae (patch)
treed76bbb5d6912c53e3bad0cf8281459c24bbf3249 /src/Compilation.zig
parentb2f8631a3c9b2cc04a4c78f38d164130be2fb1ae (diff)
downloadzig-aa6ef10cc657e2bbe59c362f27d7a557c43d7fae.tar.gz
zig-aa6ef10cc657e2bbe59c362f27d7a557c43d7fae.zip
std.Progress: make the API thread-safe
We generally get away with atomic primitives, however a lock is required around the refresh function since it traverses the Node graph, and we need to be sure no references to Nodes remain after end() is called.
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index ef07de7b17..1c27a589ee 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1378,7 +1378,7 @@ pub fn getAllErrorsAlloc(self: *Compilation) !AllErrors {
pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemory }!void {
var progress: std.Progress = .{};
- var main_progress_node = try progress.start("", null);
+ var main_progress_node = try progress.start("", 0);
defer main_progress_node.end();
if (self.color == .off) progress.terminal = null;
@@ -1811,7 +1811,7 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_comp_progress_node: *
const c_source_basename = std.fs.path.basename(c_object.src.src_path);
c_comp_progress_node.activate();
- var child_progress_node = c_comp_progress_node.start(c_source_basename, null);
+ var child_progress_node = c_comp_progress_node.start(c_source_basename, 0);
child_progress_node.activate();
defer child_progress_node.end();