aboutsummaryrefslogtreecommitdiff
path: root/lib/std/net
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2021-02-28 10:01:55 +0100
committerLemonBoy <thatlemon@gmail.com>2021-02-28 14:03:19 +0100
commit566adc2510859eaa30eb7c318260c98e712daccf (patch)
tree963d59321381ff91148c356ba761dcb5c246cf2f /lib/std/net
parente65b6d99ac38686228bf5b5b9c1121382e05da4b (diff)
downloadzig-566adc2510859eaa30eb7c318260c98e712daccf.tar.gz
zig-566adc2510859eaa30eb7c318260c98e712daccf.zip
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
Diffstat (limited to 'lib/std/net')
-rw-r--r--lib/std/net/test.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/net/test.zig b/lib/std/net/test.zig
index 10a9c4e18b..4470d17aeb 100644
--- a/lib/std/net/test.zig
+++ b/lib/std/net/test.zig
@@ -161,7 +161,7 @@ test "listen on a port, send bytes, receive bytes" {
}
};
- const t = try std.Thread.spawn(server.listen_address, S.clientFn);
+ const t = try std.Thread.spawn(S.clientFn, server.listen_address);
defer t.wait();
var client = try server.accept();
@@ -285,7 +285,7 @@ test "listen on a unix socket, send bytes, receive bytes" {
}
};
- const t = try std.Thread.spawn({}, S.clientFn);
+ const t = try std.Thread.spawn(S.clientFn, {});
defer t.wait();
var client = try server.accept();