Skip to content

Commit 469119a

Browse files
committed
ticker: fix initialization bug
the self.* must be valid when thread enters its entrypoint
1 parent cb1196e commit 469119a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bugs/ticker.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ const Region = struct {
4242
self.* = .{
4343
.id = id,
4444
.ticker = ticker,
45-
.thread = try std.Thread.spawn(.{}, @This().run, .{self}),
45+
.thread = undefined,
4646
};
47+
self.thread = try std.Thread.spawn(.{}, @This().run, .{self});
4748
}
4849

4950
pub fn deinit(self: *@This()) void {

0 commit comments

Comments
 (0)