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 --- lib/std/atomic/queue.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/std/atomic/queue.zig') diff --git a/lib/std/atomic/queue.zig b/lib/std/atomic/queue.zig index f5f63944ab..4e427a1669 100644 --- a/lib/std/atomic/queue.zig +++ b/lib/std/atomic/queue.zig @@ -216,11 +216,11 @@ test "std.atomic.Queue" { var putters: [put_thread_count]*std.Thread = undefined; for (putters) |*t| { - t.* = try std.Thread.spawn(&context, startPuts); + t.* = try std.Thread.spawn(startPuts, &context); } var getters: [put_thread_count]*std.Thread = undefined; for (getters) |*t| { - t.* = try std.Thread.spawn(&context, startGets); + t.* = try std.Thread.spawn(startGets, &context); } for (putters) |t| -- cgit v1.2.3