kernel: Skip end callbacks ín exit_delete_all_threads

Wake up threads blocked on `status_cond` or `signal` so that they can
process the `to_do = ThreadToDo::Remove`.
This commit is contained in:
Aku Kotkavuo
2026-01-24 16:51:53 +02:00
committed by Zangetsu
parent ce1807b138
commit 035227aafa
2 changed files with 10 additions and 3 deletions
+3 -3
View File
@@ -168,9 +168,9 @@ Ptr<Ptr<void>> KernelState::get_thread_tls_addr(MemState &mem, SceUID thread_id,
void KernelState::exit_delete_all_threads() {
const std::lock_guard<std::mutex> lock(mutex);
for (auto &[_, thread] : threads) {
thread->exit_delete();
}
for (auto &[_, thread] : threads)
// Skip end callbacks; running guest code can access torn-down state
thread->exit_delete(false);
}
void KernelState::pause_threads() {
+7
View File
@@ -182,6 +182,13 @@ void ThreadState::exit_delete(bool exit) {
} else {
stop(*cpu);
}
// Wake if thread waiting on status_cond
if (status == ThreadStatus::wait)
update_status(ThreadStatus::run);
// Wake if thread waiting on sceKernelWaitSignal
signal.send();
}
bool ThreadState::run_loop() {