[zion] Move process.CheckState() to prevent infinite loop on thread exit.

This commit is contained in:
Drew Galbraith 2023-11-19 17:31:01 -08:00
parent 29fa8045af
commit 2e08eb76ff
1 changed files with 1 additions and 1 deletions

View File

@ -75,12 +75,12 @@ void Thread::Exit() {
curr_thread->tid(), pid(), tid()); curr_thread->tid(), pid(), tid());
} }
Cleanup(); Cleanup();
process_.CheckState();
gScheduler->Yield(); gScheduler->Yield();
} }
void Thread::Cleanup() { void Thread::Cleanup() {
state_ = CLEANUP; state_ = CLEANUP;
process_.CheckState();
while (blocked_threads_.size() != 0) { while (blocked_threads_.size() != 0) {
auto thread = blocked_threads_.PopFront(); auto thread = blocked_threads_.PopFront();
thread->SetState(Thread::RUNNABLE); thread->SetState(Thread::RUNNABLE);