From 2e08eb76ffe349968ecd15cc5ca0736c55514457 Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Sun, 19 Nov 2023 17:31:01 -0800 Subject: [PATCH] [zion] Move process.CheckState() to prevent infinite loop on thread exit. --- zion/object/thread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);