mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-06 04:35:29 +02:00
Correctly remember callback status when sleeping.
If a callback triggered right away after a sceKernelSleepThreadCB(), it would trigger the "current callback" and remember callback status as false, instead of true (since it was set later.) This corrects that by ignoring it if both are set.
This commit is contained in:
@@ -2758,7 +2758,6 @@ int sceKernelSleepThread()
|
||||
int sceKernelSleepThreadCB()
|
||||
{
|
||||
VERBOSE_LOG(SCEKERNEL, "sceKernelSleepThreadCB()");
|
||||
hleCheckCurrentCallbacks();
|
||||
return __KernelSleepThread(true);
|
||||
}
|
||||
|
||||
@@ -2810,7 +2809,6 @@ int sceKernelWaitThreadEndCB(SceUID threadID, u32 timeoutPtr)
|
||||
Thread *t = kernelObjects.Get<Thread>(threadID, error);
|
||||
if (t)
|
||||
{
|
||||
hleCheckCurrentCallbacks();
|
||||
if (t->nt.status != THREADSTATUS_DORMANT)
|
||||
{
|
||||
if (Memory::IsValidAddress(timeoutPtr))
|
||||
@@ -2819,6 +2817,8 @@ int sceKernelWaitThreadEndCB(SceUID threadID, u32 timeoutPtr)
|
||||
t->waitingThreads.push_back(currentThread);
|
||||
__KernelWaitCurThread(WAITTYPE_THREADEND, threadID, 0, timeoutPtr, true, "thread wait end");
|
||||
}
|
||||
else
|
||||
hleCheckCurrentCallbacks();
|
||||
|
||||
return t->nt.exitStatus;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user