diff options
| author | Vexu <15308111+Vexu@users.noreply.github.com> | 2019-11-23 19:13:48 +0200 |
|---|---|---|
| committer | Vexu <15308111+Vexu@users.noreply.github.com> | 2019-11-23 19:13:48 +0200 |
| commit | 03cc81665bb28eb35c8c6d4be17b5a56fa66261f (patch) | |
| tree | e686671775e606c3cf1129b535f2c2487e4e6e3c /lib/std/atomic/stack.zig | |
| parent | 86d9563d1539cd7581dc120023bb830fae77ba0f (diff) | |
| parent | ad0871ea4bf2dfbed07282ffe14738b5347d5d32 (diff) | |
| download | zig-03cc81665bb28eb35c8c6d4be17b5a56fa66261f.tar.gz zig-03cc81665bb28eb35c8c6d4be17b5a56fa66261f.zip | |
Merge branch 'master' into modernize-stage2
Diffstat (limited to 'lib/std/atomic/stack.zig')
| -rw-r--r-- | lib/std/atomic/stack.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/atomic/stack.zig b/lib/std/atomic/stack.zig index dd288adbf1..4246e15985 100644 --- a/lib/std/atomic/stack.zig +++ b/lib/std/atomic/stack.zig @@ -11,7 +11,7 @@ pub fn Stack(comptime T: type) type { root: ?*Node, lock: @typeOf(lock_init), - const lock_init = if (builtin.single_threaded) {} else u8(0); + const lock_init = if (builtin.single_threaded) {} else @as(u8, 0); pub const Self = @This(); @@ -128,7 +128,7 @@ test "std.atomic.stack" { for (putters) |t| t.wait(); - _ = @atomicRmw(u8, &context.puts_done, builtin.AtomicRmwOp.Xchg, 1, AtomicOrder.SeqCst); + @atomicStore(u8, &context.puts_done, 1, AtomicOrder.SeqCst); for (getters) |t| t.wait(); } @@ -141,8 +141,8 @@ test "std.atomic.stack" { std.debug.panic( "failure\nget_count:{} != puts_per_thread:{} * put_thread_count:{}", context.get_count, - u32(puts_per_thread), - u32(put_thread_count), + @as(u32, puts_per_thread), + @as(u32, put_thread_count), ); } } |
