Fix assert on reset button hit.

Fixes issue 9225.
This commit is contained in:
Ryan Houdek 2016-01-09 11:20:52 -06:00
parent 5db10d83f7
commit 54e4d90b6d
3 changed files with 12 additions and 2 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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