aboutsummaryrefslogtreecommitdiff
path: root/src/ThreadPool.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/ThreadPool.zig')
-rw-r--r--src/ThreadPool.zig3
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();