mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-11-03 21:49:42 -09:00
Zig 0.16: Thread.Condition -> Io.Condition
This commit is contained in:
parent
e447acd83c
commit
b8d2702f04
1 changed files with 4 additions and 4 deletions
|
|
@ -164,7 +164,7 @@ const State = struct {
|
|||
queue: [QUEUE_SIZE]*Dir = undefined,
|
||||
queue_len: std.atomic.Value(usize) = std.atomic.Value(usize).init(0),
|
||||
queue_lock: std.Io.Mutex = .init,
|
||||
queue_cond: std.Thread.Condition = .{},
|
||||
queue_cond: std.Io.Condition = .init,
|
||||
|
||||
threads: []Thread,
|
||||
waiting: usize = 0,
|
||||
|
|
@ -183,7 +183,7 @@ const State = struct {
|
|||
const slot = self.queue_len.fetchAdd(1, .monotonic);
|
||||
self.queue[slot] = d;
|
||||
}
|
||||
self.queue_cond.signal();
|
||||
self.queue_cond.signal(main.io);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -195,10 +195,10 @@ const State = struct {
|
|||
self.waiting += 1;
|
||||
while (self.queue_len.load(.monotonic) == 0) {
|
||||
if (self.waiting == self.threads.len) {
|
||||
self.queue_cond.broadcast();
|
||||
self.queue_cond.broadcast(main.io);
|
||||
return null;
|
||||
}
|
||||
self.queue_cond.wait(&self.queue_lock);
|
||||
self.queue_cond.wait(main.io, &self.queue_lock) catch unreachable;
|
||||
}
|
||||
self.waiting -= 1;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue