aboutsummaryrefslogtreecommitdiff
path: root/std/atomic/queue.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-05-18 13:30:25 -0400
committerGitHub <noreply@github.com>2018-05-18 13:30:25 -0400
commit83a78094788038fcf487e5947945a1f5900d564a (patch)
treea8639a11bea5a2fc2b9c5aebf30011f7675f37d7 /std/atomic/queue.zig
parent942d384831196acf24868c32ef84409b05441960 (diff)
parentc38b165db4a16ba6a5c6d13537177db656fc4033 (diff)
downloadzig-83a78094788038fcf487e5947945a1f5900d564a.tar.gz
zig-83a78094788038fcf487e5947945a1f5900d564a.zip
Merge pull request #1019 from zig-lang/pointer-reform
Pointer Reform - change prefix deref syntax to postfix deref syntax
Diffstat (limited to 'std/atomic/queue.zig')
-rw-r--r--std/atomic/queue.zig12
1 files changed, 7 insertions, 5 deletions
diff --git a/std/atomic/queue.zig b/std/atomic/queue.zig
index e25c8e6b17..288a2b3b48 100644
--- a/std/atomic/queue.zig
+++ b/std/atomic/queue.zig
@@ -70,7 +70,7 @@ test "std.atomic.queue" {
var queue: Queue(i32) = undefined;
queue.init();
- var context = Context {
+ var context = Context{
.allocator = a,
.queue = &queue,
.put_sum = 0,
@@ -81,16 +81,18 @@ test "std.atomic.queue" {
var putters: [put_thread_count]&std.os.Thread = undefined;
for (putters) |*t| {
- *t = try std.os.spawnThread(&context, startPuts);
+ t.* = try std.os.spawnThread(&context, startPuts);
}
var getters: [put_thread_count]&std.os.Thread = undefined;
for (getters) |*t| {
- *t = try std.os.spawnThread(&context, startGets);
+ t.* = try std.os.spawnThread(&context, startGets);
}
- for (putters) |t| t.wait();
+ for (putters) |t|
+ t.wait();
_ = @atomicRmw(u8, &context.puts_done, builtin.AtomicRmwOp.Xchg, 1, AtomicOrder.SeqCst);
- for (getters) |t| t.wait();
+ for (getters) |t|
+ t.wait();
std.debug.assert(context.put_sum == context.get_sum);
std.debug.assert(context.get_count == puts_per_thread * put_thread_count);