Fix an issue where more than one GameMode Scheduler can be scheduled.

This commit is contained in:
ANR2ME committed 2022-01-13 14:02:33 +07:00
1 parent 4d0c7385ec
commit 73dff0566e
1 file changed
+4
+4
View File
@@ -440,6 +440,10 @@ int ScheduleAdhocctlState(int event, int newState, int usec, const char* reason)
int StartGameModeScheduler() {
INFO_LOG(SCENET, "Initiating GameMode Scheduler");
if (CoreTiming::IsScheduled(gameModeNotifyEvent)) {
WARN_LOG(SCENET, "GameMode Scheduler is already running!");
return -1;
}
u64 param = ((u64)__KernelGetCurThread()) << 32;
CoreTiming::ScheduleEvent(usToCycles(GAMEMODE_INIT_DELAY), gameModeNotifyEvent, param);
return 0;