Merge pull request #3482 from Sonicadvance1/fix_9225
Fix assert on reset button hit.
This commit is contained in:
commit
97475e5e6a
|
@ -258,6 +258,15 @@ void ScheduleEvent_Threadsafe_Immediate(int event_type, u64 userdata)
|
|||
}
|
||||
}
|
||||
|
||||
// To be used from any thread, including the CPU thread
|
||||
void ScheduleEvent_AnyThread(int cyclesIntoFuture, int event_type, u64 userdata)
|
||||
{
|
||||
if (Core::IsCPUThread())
|
||||
ScheduleEvent(cyclesIntoFuture, event_type, userdata);
|
||||
else
|
||||
ScheduleEvent_Threadsafe(cyclesIntoFuture, event_type, userdata);
|
||||
}
|
||||
|
||||
void ClearPendingEvents()
|
||||
{
|
||||
while (first)
|
||||
|
|
|
@ -48,6 +48,7 @@ void ScheduleEvent(int cyclesIntoFuture, int event_type, u64 userdata = 0);
|
|||
void ScheduleEvent_Immediate(int event_type, u64 userdata = 0);
|
||||
void ScheduleEvent_Threadsafe(int cyclesIntoFuture, int event_type, u64 userdata = 0);
|
||||
void ScheduleEvent_Threadsafe_Immediate(int event_type, u64 userdata = 0);
|
||||
void ScheduleEvent_AnyThread(int cyclesIntoFuture, int event_type, u64 userdata = 0);
|
||||
|
||||
// We only permit one event of each type in the queue at a time.
|
||||
void RemoveEvent(int event_type);
|
||||
|
|
|
@ -223,8 +223,8 @@ void ToggleResetButtonCallback(u64 userdata, int cyclesLate)
|
|||
|
||||
void ResetButton_Tap()
|
||||
{
|
||||
CoreTiming::ScheduleEvent_Threadsafe(0, toggleResetButton, true);
|
||||
CoreTiming::ScheduleEvent_Threadsafe(243000000, toggleResetButton, false);
|
||||
CoreTiming::ScheduleEvent_AnyThread(0, toggleResetButton, true);
|
||||
CoreTiming::ScheduleEvent_AnyThread(243000000, toggleResetButton, false);
|
||||
}
|
||||
|
||||
} // namespace ProcessorInterface
|
||||
|
|
Loading…
Reference in New Issue