From 566adc2510859eaa30eb7c318260c98e712daccf Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sun, 28 Feb 2021 10:01:55 +0100 Subject: std: Swap arguments in Thread.spawn Beside the new order being consistent with the ThreadPool API and making more sense, this shuffling allows to write the context argument type in terms of the startFn arguments, reducing the use of anytype (eg. less explicit casts when using comptime_int parameters, yay). Sorry for the breakage. Closes #8082 --- src/ThreadPool.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ThreadPool.zig') diff --git a/src/ThreadPool.zig b/src/ThreadPool.zig index ec580210e9..e66742b49e 100644 --- a/src/ThreadPool.zig +++ b/src/ThreadPool.zig @@ -74,7 +74,7 @@ pub fn init(self: *ThreadPool, allocator: *std.mem.Allocator) !void { try worker.idle_node.data.init(); errdefer worker.idle_node.data.deinit(); - worker.thread = try std.Thread.spawn(worker, Worker.run); + worker.thread = try std.Thread.spawn(Worker.run, worker); } } -- cgit v1.2.3