mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
std.event.Loop: fix race condition when starting the time wheel
closes #7572
This commit is contained in:
parent
0edde40c25
commit
8ea2b40e5f
@ -796,9 +796,10 @@ pub const Loop = struct {
|
||||
.waiters = DelayQueue.Waiters{
|
||||
.entries = std.atomic.Queue(anyframe).init(),
|
||||
},
|
||||
.thread = try std.Thread.spawn(self, DelayQueue.run),
|
||||
.event = std.AutoResetEvent{},
|
||||
.is_running = true,
|
||||
// Must be last so that it can read the other state, such as `is_running`.
|
||||
.thread = try std.Thread.spawn(self, DelayQueue.run),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user