aboutsummaryrefslogtreecommitdiff
path: root/std/atomic/stack.zig
diff options
context:
space:
mode:
Diffstat (limited to 'std/atomic/stack.zig')
-rw-r--r--std/atomic/stack.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/std/atomic/stack.zig b/std/atomic/stack.zig
index b69a93733c..9222b8de50 100644
--- a/std/atomic/stack.zig
+++ b/std/atomic/stack.zig
@@ -5,19 +5,19 @@ const AtomicOrder = builtin.AtomicOrder;
/// Many reader, many writer, non-allocating, thread-safe
/// Uses a spinlock to protect push() and pop()
pub fn Stack(comptime T: type) type {
- return struct {
+ return struct.{
root: ?*Node,
lock: u8,
pub const Self = @This();
- pub const Node = struct {
+ pub const Node = struct.{
next: ?*Node,
data: T,
};
pub fn init() Self {
- return Self{
+ return Self.{
.root = null,
.lock = 0,
};
@@ -54,7 +54,7 @@ pub fn Stack(comptime T: type) type {
}
const std = @import("../index.zig");
-const Context = struct {
+const Context = struct.{
allocator: *std.mem.Allocator,
stack: *Stack(i32),
put_sum: isize,
@@ -81,7 +81,7 @@ test "std.atomic.stack" {
var a = &fixed_buffer_allocator.allocator;
var stack = Stack(i32).init();
- var context = Context{
+ var context = Context.{
.allocator = a,
.stack = &stack,
.put_sum = 0,
@@ -125,7 +125,7 @@ fn startPuts(ctx: *Context) u8 {
while (put_count != 0) : (put_count -= 1) {
std.os.time.sleep(1); // let the os scheduler be our fuzz
const x = @bitCast(i32, r.random.scalar(u32));
- const node = ctx.allocator.create(Stack(i32).Node{
+ const node = ctx.allocator.create(Stack(i32).Node.{
.next = undefined,
.data = x,
}) catch unreachable;