[Zion] Move existing proc/thread cleanup calls to the cleanup thread.

This commit is contained in:
Drew Galbraith 2023-11-24 15:39:43 -08:00
parent 8bedc80caf
commit 8fb5b7c03c
6 changed files with 67 additions and 34 deletions

View file

@ -8,11 +8,13 @@ void ProcessCleanup::CleanupLoop() {
// TODO: I think we need to protect these lists with a mutex as well.
while (!process_list_.empty()) {
auto proc = process_list_.PopFront();
dbgln("CLEANUP Proc {}", proc->id());
dbgln("CLEANUP Process: {}", proc->id());
proc->Cleanup();
}
while (!thread_list_.empty()) {
auto thread = thread_list_.PopFront();
dbgln("CLEANUP Thread {}.{}", thread->pid(), thread->tid());
dbgln("CLEANUP Thread: {}.{}", thread->pid(), thread->tid());
thread->Cleanup();
}
}
}