1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-22 18:26:39 +00:00

Fix gamecard deadlock.

This commit is contained in:
Pablo Curiel 2020-05-02 20:36:09 -04:00
parent 2e48a22f8c
commit 109913cb18

View file

@ -520,16 +520,11 @@ static int gamecardDetectionThreadFunc(void *arg)
Waiter gamecard_event_waiter = waiterForEvent(&g_gameCardKernelEvent);
Waiter exit_event_waiter = waiterForUEvent(&g_gameCardDetectionThreadExitEvent);
mutexLock(&g_gamecardMutex);
/* Retrieve initial gamecard insertion status */
g_gameCardInserted = prev_status = gamecardIsInserted();
/* Load gamecard info right away if a gamecard is inserted */
g_gameCardInserted = prev_status = gamecardIsInserted();
if (g_gameCardInserted) gamecardLoadInfo();
mutexUnlock(&g_gamecardMutex);
while(true)
{
/* Wait until an event is triggered */
@ -563,10 +558,8 @@ static int gamecardDetectionThreadFunc(void *arg)
}
/* Free gamecard info and close gamecard handle */
mutexLock(&g_gamecardMutex);
gamecardFreeInfo();
g_gameCardInserted = false;
mutexUnlock(&g_gamecardMutex);
return 0;
}