[Zion] Don't try to set state on dying threads in cleanup.

This commit is contained in:
Drew Galbraith 2025-05-03 14:54:03 -07:00
parent 26ff82cf54
commit f918966727
1 changed files with 4 additions and 2 deletions

View File

@ -120,8 +120,10 @@ void Thread::Cleanup() {
// 2. Unblock waiting threads. // 2. Unblock waiting threads.
while (blocked_threads_.size() != 0) { while (blocked_threads_.size() != 0) {
auto thread = blocked_threads_.PopFront(); auto thread = blocked_threads_.PopFront();
thread->SetState(Thread::RUNNABLE); if (!thread->IsDying()) {
gScheduler->Enqueue(thread); thread->SetState(Thread::RUNNABLE);
gScheduler->Enqueue(thread);
}
} }
// 3. Release Kernel Stack // 3. Release Kernel Stack