Don't process threadsafe events from HLE.

Only from the runloop where blowing the jit cache is safe.
This commit is contained in:
Unknown W. Brackets 2013-02-22 00:38:22 -08:00
parent 44e2a69258
commit 31ada1ea07
3 changed files with 14 additions and 11 deletions

View File

@ -422,12 +422,6 @@ void RemoveAllEvents(int event_type)
//This raise only the events required while the fifo is processing data
void ProcessFifoWaitEvents()
{
if (Common::AtomicLoadAcquire(hasTsEvents))
MoveEvents();
if (!first)
return;
while (first)
{
if (first->time <= globalTimer)
@ -471,14 +465,12 @@ void MoveEvents()
}
}
void Advance()
void AdvanceQuick()
{
int cyclesExecuted = slicelength - currentMIPS->downcount;
globalTimer += cyclesExecuted;
currentMIPS->downcount = slicelength;
ProcessFifoWaitEvents();
if (!first)
{
// WARN_LOG(CPU, "WARNING - no events in queue. Setting currentMIPS->downcount to 10000");
@ -486,6 +478,8 @@ void Advance()
}
else
{
ProcessFifoWaitEvents();
slicelength = (int)(first->time - globalTimer);
if (slicelength > MAX_SLICE_LENGTH)
slicelength = MAX_SLICE_LENGTH;
@ -495,6 +489,14 @@ void Advance()
advanceCallback(cyclesExecuted);
}
void Advance()
{
if (Common::AtomicLoadAcquire(hasTsEvents))
MoveEvents();
AdvanceQuick();
}
void LogPendingEvents()
{
Event *ptr = first;

View File

@ -100,6 +100,7 @@ namespace CoreTiming
void RemoveAllEvents(int event_type);
bool IsScheduled(int event_type);
void Advance();
void AdvanceQuick();
void MoveEvents();
void ProcessFifoWaitEvents();

View File

@ -795,7 +795,7 @@ void __KernelIdle()
CoreTiming::Idle();
// Advance must happen between Idle and Reschedule, so that threads that were waiting for something
// that was triggered at the end of the Idle period must get a chance to be scheduled.
CoreTiming::Advance();
CoreTiming::AdvanceQuick();
// We must've exited a callback?
if (__KernelInCallback())
@ -1263,7 +1263,7 @@ void __KernelReSchedule(const char *reason)
}
// Execute any pending events while we're doing scheduling.
CoreTiming::Advance();
CoreTiming::AdvanceQuick();
if (__IsInInterrupt() || __KernelInCallback())
{
reason = "In Interrupt Or Callback";