Io: Destroy async threads on reset.

Oops, this left us in a different state on exit.
This commit is contained in:
Unknown W. Brackets 2019-10-20 10:25:57 -07:00
parent c7b3a08cf3
commit 4065fae262
2 changed files with 11 additions and 2 deletions

View File

@ -737,6 +737,15 @@ void __IoShutdown() {
ioManager.Shutdown();
}
for (int i = 0; i < PSP_COUNT_FDS; ++i) {
asyncParams[i].op = IoAsyncOp::NONE;
asyncParams[i].priority = -1;
if (asyncThreads[i])
asyncThreads[i]->Forget();
delete asyncThreads[i];
asyncThreads[i] = nullptr;
}
pspFileSystem.Unmount("ms0:", memstickSystem);
pspFileSystem.Unmount("fatms0:", memstickSystem);
pspFileSystem.Unmount("fatms:", memstickSystem);

View File

@ -1641,9 +1641,9 @@ void __KernelStopThread(SceUID threadID, int exitStatus, const char *reason)
// Stopped threads are never waiting.
t->nt.waitType = WAITTYPE_NONE;
t->nt.waitID = 0;
}
else
} else {
ERROR_LOG_REPORT(SCEKERNEL, "__KernelStopThread: thread %d does not exist", threadID);
}
}
u32 __KernelDeleteThread(SceUID threadID, int exitStatus, const char *reason)