mirror of
https://github.com/Vita3K/Vita3K.git
synced 2026-07-11 01:34:23 +02:00
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:
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user