[zion] Move process.CheckState() to prevent infinite loop on thread exit.
This commit is contained in:
parent
29fa8045af
commit
2e08eb76ff
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue