From dd375201a9fd44d1a58f5946dc83018afa240dec Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 21 Apr 2024 21:45:39 -0400 Subject: kernel: sched: Ensure td is removed from queue Upon sched_exit(), the thread should not be in the queue Signed-off-by: Ian Moffett --- sys/kern/kern_sched.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c index 1d9ba11..9551265 100644 --- a/sys/kern/kern_sched.c +++ b/sys/kern/kern_sched.c @@ -358,6 +358,7 @@ sched_exit(void) /* Switch back to the kernel address space and destroy ourself */ pmap_switch_vas(vm_get_ctx(), kvas); + TAILQ_REMOVE(&td_queue, td, link); sched_destroy_td(td); intr_unmask(); -- cgit v1.2.3