Merge pull request #430 from unknownbrackets/thread-funcs

Remove some thread stack hacks that aren't needed.
This commit is contained in:
Henrik Rydgård 2013-01-15 23:40:19 -08:00
commit e23365dfa9

View File

@ -1534,9 +1534,6 @@ void sceKernelExitDeleteThread()
t->nt.status = THREADSTATUS_DORMANT;
t->nt.exitStatus = PARAM(0);
__KernelFireThreadEnd(t);
// TODO: Why not?
//userMemory.Free(currentThread->stackBlock);
t->stackBlock = 0;
__KernelRemoveFromThreadQueue(t);
currentThread = 0;
@ -1612,12 +1609,22 @@ int sceKernelTerminateDeleteThread(int threadno)
//TODO: remove from threadqueue!
INFO_LOG(HLE, "sceKernelTerminateDeleteThread(%i)", threadno);
u32 error;
Thread *t = kernelObjects.Get<Thread>(threadno, error);
if (t)
{
__KernelRemoveFromThreadQueue(t);
__KernelFireThreadEnd(t);
//TODO: should we really reschedule here?
__KernelTriggerWait(WAITTYPE_THREADEND, threadno, SCE_KERNEL_ERROR_THREAD_TERMINATED, false);
hleReSchedule("termdeletethread");
// TODO: Why not delete?
return 0; //kernelObjects.Destroy<Thread>(threadno));
return kernelObjects.Destroy<Thread>(threadno);
}
// TODO: Error when doesn't exist?
return 0;
}
else
{