From ad7f14ecb8d385cfdb3f599ef971c8b50a609ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Gr=C3=A9goire?= Date: Sat, 10 Oct 2026 09:37:20 -0400 Subject: [PATCH] ke: detach from queue on thread exit --- src/kern/thread.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/kern/thread.zig b/src/kern/thread.zig index 6e3834d..ccbfede 100644 --- a/src/kern/thread.zig +++ b/src/kern/thread.zig @@ -285,6 +285,11 @@ pub fn exit() void { curtd.lock.acquire_no_ipl(); curtd.state.store(.Zombie, .monotonic); + if (curtd.queue) |q| { + curtd.queue = null; + kep.queue.signal_wait(q); + } + if (config.warden) { // There is normally a dispatch object -> thread ordering, but here we // have a thread -> dispatch object ordering because we insert into a