pm: mitigate libctru race condition+kernel bug
(when doing dirty hb chainload)
This commit is contained in:
parent
d09bfaf348
commit
a812990f0d
@ -419,6 +419,11 @@ static void ChainloadHomebrewDirtyAsync(void *argdata)
|
|||||||
}
|
}
|
||||||
ProcessList_Unlock(&g_manager.processList);
|
ProcessList_Unlock(&g_manager.processList);
|
||||||
|
|
||||||
|
// Account for race condition with libctru (till January 2023), causing
|
||||||
|
// a deadlock between svcExitProcess and svcTerminateProcess, which wouldn't happen
|
||||||
|
// if Nintendo were using proper atomics.
|
||||||
|
svcSleepThread(50 * 1000 * 1000LL);
|
||||||
|
|
||||||
res = commitPendingTerminations(3 * 1000 * 1000 * 1000LL); // 3s, what NS is using
|
res = commitPendingTerminations(3 * 1000 * 1000 * 1000LL); // 3s, what NS is using
|
||||||
ExHeaderInfoHeap_Delete(exheaderInfo);
|
ExHeaderInfoHeap_Delete(exheaderInfo);
|
||||||
g_manager.waitingForTermination = false;
|
g_manager.waitingForTermination = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user