Prevent waiting on semas while dispatch disabled.

Does relatively well on tests this way.
This commit is contained in:
Unknown W. Brackets committed 2013-03-24 23:30:32 -07:00
1 parent e133d33167
commit 276037675f
5 files changed
+30 -10

No files matched your search

+8 -2
View File
@@ -1284,7 +1284,7 @@ Thread *__KernelNextThread() {
void __KernelReSchedule(const char *reason)
{
// cancel rescheduling when in interrupt or callback, otherwise everything will be fucked up
if (__IsInInterrupt() || __KernelInCallback() || !__InterruptsEnabled())
if (__IsInInterrupt() || __KernelInCallback() || !__KernelIsDispatchEnabled())
{
reason = "In Interrupt Or Callback";
return;
@@ -1299,7 +1299,7 @@ void __KernelReSchedule(const char *reason)
// Execute any pending events while we're doing scheduling.
CoreTiming::AdvanceQuick();
if (__IsInInterrupt() || __KernelInCallback() || !__InterruptsEnabled())
if (__IsInInterrupt() || __KernelInCallback() || !__KernelIsDispatchEnabled())
{
reason = "In Interrupt Or Callback";
return;
@@ -1717,6 +1717,12 @@ u32 sceKernelResumeDispatchThread(u32 enabled)
return 0;
}
bool __KernelIsDispatchEnabled()
{
// Dispatch can never be enabled when interrupts are disabled.
return dispatchEnabled && __InterruptsEnabled();
}
int sceKernelRotateThreadReadyQueue(int priority)
{
DEBUG_LOG(HLE, "sceKernelRotateThreadReadyQueue(%x)", priority);