diff options
Diffstat (limited to 'lib/std/Thread')
| -rw-r--r-- | lib/std/Thread/Pool.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/std/Thread/Pool.zig b/lib/std/Thread/Pool.zig index 86bac7ce46..874050a35f 100644 --- a/lib/std/Thread/Pool.zig +++ b/lib/std/Thread/Pool.zig @@ -27,6 +27,7 @@ pub const Options = struct { allocator: std.mem.Allocator, n_jobs: ?usize = null, track_ids: bool = false, + stack_size: usize = std.Thread.SpawnConfig.default_stack_size, }; pub fn init(pool: *Pool, options: Options) !void { @@ -54,7 +55,10 @@ pub fn init(pool: *Pool, options: Options) !void { errdefer pool.join(spawned); for (pool.threads) |*thread| { - thread.* = try std.Thread.spawn(.{}, worker, .{pool}); + thread.* = try std.Thread.spawn(.{ + .stack_size = options.stack_size, + .allocator = allocator, + }, worker, .{pool}); spawned += 1; } } |
