Make sceKernelStartThread() reschedule.

Mutexes and semaphores are wrong, duh.
This commit is contained in:
Unknown W. Brackets committed 2012-11-20 02:20:13 -08:00
1 parent 7b9a8bf766
commit b9bb5c4cce
3 files changed
+13 -11

No files matched your search

+1 -1
View File
@@ -371,7 +371,7 @@ const HLEFunction ThreadManForUser[] =
{0x912354a7,sceKernelRotateThreadReadyQueue,"sceKernelRotateThreadReadyQueue"},
{0x9ACE131E,sceKernelSleepThread,"sceKernelSleepThread"},
{0x82826f70,sceKernelSleepThreadCB,"sceKernelSleepThreadCB"},
{0xF475845D,&WrapU_V<sceKernelStartThread>,"sceKernelStartThread"},
{0xF475845D,&WrapV_IUU<sceKernelStartThread>,"sceKernelStartThread"},
{0x9944f31f,sceKernelSuspendThread,"sceKernelSuspendThread"},
{0x616403ba,0,"sceKernelTerminateThread"},
{0x383f7bcc,sceKernelTerminateDeleteThread,"sceKernelTerminateDeleteThread"},
+11 -9
View File
@@ -829,12 +829,10 @@ void sceKernelCreateThread()
}
u32 sceKernelStartThread()
// int sceKernelStartThread(SceUID threadToStartID, SceSize argSize, void *argBlock)
// void because it reschedules.
void sceKernelStartThread(SceUID threadToStartID, u32 argSize, u32 argBlockPtr)
{
int threadToStartID = PARAM(0);
u32 argSize = PARAM(1);
u32 argBlockPtr = PARAM(2);
if (threadToStartID != currentThread->GetUID())
{
u32 error;
@@ -843,13 +841,15 @@ u32 sceKernelStartThread()
{
ERROR_LOG(HLE,"%08x=sceKernelStartThread(thread=%i, argSize=%i, argPtr= %08x): thread does not exist!",
error,threadToStartID,argSize,argBlockPtr)
return error;
RETURN(error);
return;
}
if (startThread->nt.status != THREADSTATUS_DORMANT)
{
//Not dormant, WTF?
return ERROR_KERNEL_THREAD_IS_NOT_DORMANT;
RETURN(ERROR_KERNEL_THREAD_IS_NOT_DORMANT);
return;
}
INFO_LOG(HLE,"sceKernelStartThread(thread=%i, argSize=%i, argPtr= %08x )",
@@ -876,12 +876,14 @@ u32 sceKernelStartThread()
if (!argBlockPtr && argSize > 0) {
WARN_LOG(HLE,"sceKernelStartThread : had NULL arg");
}
return 0;
RETURN(0);
__KernelReSchedule("thread started");
}
else
{
ERROR_LOG(HLE,"thread %i trying to start itself", threadToStartID);
return -1;
RETURN(-1);
}
}
+1 -1
View File
@@ -35,7 +35,7 @@ void sceKernelExitThread();
void _sceKernelExitThread();
void sceKernelGetThreadId();
void sceKernelGetThreadCurrentPriority();
u32 sceKernelStartThread();
void sceKernelStartThread(SceUID threadToStartID, u32 argSize, u32 argBlockPtr);
u32 sceKernelSuspendDispatchThread();
u32 sceKernelResumeDispatchThread(u32 suspended);
void sceKernelWaitThreadEnd();