Don't reschedule while interrupts are disabled.

This commit is contained in:
Unknown W. Brackets 2013-03-24 19:43:56 -07:00
parent b2fd023038
commit c9e1b01545
2 changed files with 3 additions and 2 deletions

View File

@ -128,6 +128,7 @@ private:
std::map<int, SubIntrHandler> subIntrHandlers;
};
bool __InterruptsEnabled();
bool __IsInInterrupt();
void __InterruptsInit();
void __InterruptsDoState(PointerWrap &p);

View File

@ -1283,7 +1283,7 @@ Thread *__KernelNextThread() {
void __KernelReSchedule(const char *reason)
{
// cancel rescheduling when in interrupt or callback, otherwise everything will be fucked up
if (__IsInInterrupt() || __KernelInCallback())
if (__IsInInterrupt() || __KernelInCallback() || !__InterruptsEnabled())
{
reason = "In Interrupt Or Callback";
return;
@ -1298,7 +1298,7 @@ void __KernelReSchedule(const char *reason)
// Execute any pending events while we're doing scheduling.
CoreTiming::AdvanceQuick();
if (__IsInInterrupt() || __KernelInCallback())
if (__IsInInterrupt() || __KernelInCallback() || !__InterruptsEnabled())
{
reason = "In Interrupt Or Callback";
return;