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:
Unknown W. Brackets committed 2014-06-28 03:06:30 -07:00
1 parent 9351fe44ea
commit 10096b94f2
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -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;
}