diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-10-23 22:56:04 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-23 22:56:04 -0700 |
| commit | c563ba6b15b65ecdc1cb538c9437e11dfb330453 (patch) | |
| tree | 99dd968efc3daea52a1d3628b7d8cedba53e84b7 /lib/std/Thread | |
| parent | 33d07f4b6efe461ee3fbfa32cb18f60aac8c2827 (diff) | |
| parent | 4bdc2d38717b5655acd862a5762e069419b158c7 (diff) | |
| download | zig-c563ba6b15b65ecdc1cb538c9437e11dfb330453.tar.gz zig-c563ba6b15b65ecdc1cb538c9437e11dfb330453.zip | |
Merge pull request #21700 from ziglang/cli-lib-dirs
move linker input file parsing to the frontend
Diffstat (limited to 'lib/std/Thread')
| -rw-r--r-- | lib/std/Thread/WaitGroup.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/std/Thread/WaitGroup.zig b/lib/std/Thread/WaitGroup.zig index bdc49587bf..52e9c379c2 100644 --- a/lib/std/Thread/WaitGroup.zig +++ b/lib/std/Thread/WaitGroup.zig @@ -14,6 +14,11 @@ pub fn start(self: *WaitGroup) void { assert((state / one_pending) < (std.math.maxInt(usize) / one_pending)); } +pub fn startMany(self: *WaitGroup, n: usize) void { + const state = self.state.fetchAdd(one_pending * n, .monotonic); + assert((state / one_pending) < (std.math.maxInt(usize) / one_pending)); +} + pub fn finish(self: *WaitGroup) void { const state = self.state.fetchSub(one_pending, .acq_rel); assert((state / one_pending) > 0); |
