diff --git a/zion/object/thread.cpp b/zion/object/thread.cpp index c9c699d..7d36617 100644 --- a/zion/object/thread.cpp +++ b/zion/object/thread.cpp @@ -75,12 +75,12 @@ void Thread::Exit() { curr_thread->tid(), pid(), tid()); } Cleanup(); + process_.CheckState(); gScheduler->Yield(); } void Thread::Cleanup() { state_ = CLEANUP; - process_.CheckState(); while (blocked_threads_.size() != 0) { auto thread = blocked_threads_.PopFront(); thread->SetState(Thread::RUNNABLE);