diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-07-04 22:31:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-04 22:31:02 -0400 |
| commit | b7da1b2d45bc42a56eea3a143e4237a0712c4769 (patch) | |
| tree | 5474938657d5dfd9273562c160ad5f1e3a02b824 /lib/std/atomic/queue.zig | |
| parent | 5d0dad9acdac854d68e1447b90fd3dbde9ff0b2d (diff) | |
| parent | c8f90a7e7e10be62634454bf124bef3c6130a0db (diff) | |
| download | zig-b7da1b2d45bc42a56eea3a143e4237a0712c4769.tar.gz zig-b7da1b2d45bc42a56eea3a143e4237a0712c4769.zip | |
Merge pull request #9175 from kprotty/thread
std.Thread enhancements
Diffstat (limited to 'lib/std/atomic/queue.zig')
| -rw-r--r-- | lib/std/atomic/queue.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/std/atomic/queue.zig b/lib/std/atomic/queue.zig index cc5b20488b..cee431951c 100644 --- a/lib/std/atomic/queue.zig +++ b/lib/std/atomic/queue.zig @@ -214,20 +214,20 @@ test "std.atomic.Queue" { } else { try expect(context.queue.isEmpty()); - var putters: [put_thread_count]*std.Thread = undefined; + var putters: [put_thread_count]std.Thread = undefined; for (putters) |*t| { - t.* = try std.Thread.spawn(startPuts, &context); + t.* = try std.Thread.spawn(.{}, startPuts, .{&context}); } - var getters: [put_thread_count]*std.Thread = undefined; + var getters: [put_thread_count]std.Thread = undefined; for (getters) |*t| { - t.* = try std.Thread.spawn(startGets, &context); + t.* = try std.Thread.spawn(.{}, startGets, .{&context}); } for (putters) |t| - t.wait(); + t.join(); @atomicStore(bool, &context.puts_done, true, .SeqCst); for (getters) |t| - t.wait(); + t.join(); try expect(context.queue.isEmpty()); } |
