mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-23 16:19:44 +00:00
Merge pull request #762 from unknownbrackets/savestates
Don't process threadsafe events from HLE.
This commit is contained in:
commit
9ab790ca8f
@ -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;
|
||||
|
@ -100,6 +100,7 @@ namespace CoreTiming
|
||||
void RemoveAllEvents(int event_type);
|
||||
bool IsScheduled(int event_type);
|
||||
void Advance();
|
||||
void AdvanceQuick();
|
||||
void MoveEvents();
|
||||
void ProcessFifoWaitEvents();
|
||||
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user