kernel: wait for threads to stop on pause

This commit is contained in:
Liam 2022-06-18 16:54:33 -04:00
parent 5b2b15091f
commit 24d7aaf43c
3 changed files with 22 additions and 0 deletions

View file

@ -1079,6 +1079,13 @@ void KernelCore::Suspend(bool suspended) {
for (auto* process : GetProcessList()) {
process->SetActivity(activity);
if (should_suspend) {
// Wait for execution to stop
for (auto* thread : process->GetThreadList()) {
thread->WaitUntilSuspended();
}
}
}
}