Disallow suspend/resume on current thread.

Might be some extra subtle things with callbacks/interrupts here...
This commit is contained in:
Unknown W. Brackets 2013-05-26 02:25:53 -07:00
parent e6795b1a41
commit 2c4254d0c8

View File

@ -2486,6 +2486,13 @@ int sceKernelReleaseWaitThread(SceUID threadID)
int sceKernelSuspendThread(SceUID threadID)
{
// TODO: What about interrupts/callbacks?
if (threadID == 0 || threadID == currentThread)
{
ERROR_LOG(HLE, "sceKernelSuspendThread(%d): cannot suspend current thread", threadID);
return SCE_KERNEL_ERROR_ILLEGAL_THID;
}
u32 error;
Thread *t = kernelObjects.Get<Thread>(threadID, error);
if (t)
@ -2516,6 +2523,13 @@ int sceKernelSuspendThread(SceUID threadID)
int sceKernelResumeThread(SceUID threadID)
{
// TODO: What about interrupts/callbacks?
if (threadID == 0 || threadID == currentThread)
{
ERROR_LOG(HLE, "sceKernelSuspendThread(%d): cannot suspend current thread", threadID);
return SCE_KERNEL_ERROR_ILLEGAL_THID;
}
u32 error;
Thread *t = kernelObjects.Get<Thread>(threadID, error);
if (t)