diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-02-07 00:31:17 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-07 00:31:17 -0500 |
| commit | 21135387fb7c2dbaf70a72f2c97341e9c1307045 (patch) | |
| tree | 5926ea2d182a76f80429776a5473202738c9b656 /src/ThreadPool.zig | |
| parent | 069dd01ce4ced3cb9664e4f1e09be753cb3ed476 (diff) | |
| parent | 33fa29601921d88097a1ee3c0d92b93047a5186d (diff) | |
| download | zig-21135387fb7c2dbaf70a72f2c97341e9c1307045.tar.gz zig-21135387fb7c2dbaf70a72f2c97341e9c1307045.zip | |
Merge pull request #10782 from topolarity/gate-child-processes
Avoid depending on child process execution when not supported by host OS
Diffstat (limited to 'src/ThreadPool.zig')
| -rw-r--r-- | src/ThreadPool.zig | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ThreadPool.zig b/src/ThreadPool.zig index 4f9d8dc015..813d67db66 100644 --- a/src/ThreadPool.zig +++ b/src/ThreadPool.zig @@ -82,6 +82,9 @@ pub fn init(self: *ThreadPool, allocator: std.mem.Allocator) !void { } fn destroyWorkers(self: *ThreadPool, spawned: usize) void { + if (builtin.single_threaded) + return; + for (self.workers[0..spawned]) |*worker| { worker.thread.join(); worker.idle_node.data.deinit(); |
