mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-17 00:10:31 +02:00
Add some paranoid checks hoping to fix crashes reported in Google Play developer console.
This commit is contained in:
1 parent
774539dea8
commit
4197148dc4
8 files changed
+83
-42
No files matched your search
@@ -1703,29 +1703,29 @@ void __KernelReSchedule(const char *reason)
|
||||
|
||||
// Execute any pending events while we're doing scheduling.
|
||||
CoreTiming::Advance();
|
||||
if (__IsInInterrupt() || !__KernelIsDispatchEnabled())
|
||||
{
|
||||
if (__IsInInterrupt() || !__KernelIsDispatchEnabled()) {
|
||||
// Threads don't get changed within interrupts or while dispatch is disabled.
|
||||
reason = "In Interrupt Or Callback";
|
||||
return;
|
||||
}
|
||||
|
||||
Thread *nextThread = __KernelNextThread();
|
||||
if (nextThread)
|
||||
if (nextThread) {
|
||||
__KernelSwitchContext(nextThread, reason);
|
||||
}
|
||||
// Otherwise, no need to switch.
|
||||
}
|
||||
|
||||
void __KernelReSchedule(bool doCallbacks, const char *reason)
|
||||
{
|
||||
Thread *thread = __GetCurrentThread();
|
||||
if (doCallbacks)
|
||||
{
|
||||
if (thread)
|
||||
thread->isProcessingCallbacks = doCallbacks;
|
||||
if (doCallbacks && thread != nullptr) {
|
||||
thread->isProcessingCallbacks = doCallbacks;
|
||||
}
|
||||
|
||||
// Note - this calls the function above, not this one. Overloading...
|
||||
__KernelReSchedule(reason);
|
||||
if (doCallbacks && thread != NULL && thread->GetUID() == currentThread) {
|
||||
if (doCallbacks && thread != nullptr && thread->GetUID() == currentThread) {
|
||||
if (thread->isRunning()) {
|
||||
thread->isProcessingCallbacks = false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user