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
This commit is contained in:
LemonBoy
2021-02-28 10:01:55 +01:00
parent e65b6d99ac
commit 566adc2510
13 changed files with 49 additions and 35 deletions

View File

@@ -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);
}
}