mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 03:44:32 +01:00
Merge pull request #13372 from sum2012/kernel_minor
Add a check in sceKernelTerminateThread
This commit is contained in:
1 file changed
+5
-3
@@ -2149,7 +2149,7 @@ void __KernelReturnFromThread()
|
||||
}
|
||||
|
||||
int sceKernelExitThread(int exitStatus) {
|
||||
if (!__KernelIsDispatchEnabled() && sceKernelGetCompiledSdkVersion() > 0x0307FFFF)
|
||||
if (!__KernelIsDispatchEnabled() && sceKernelGetCompiledSdkVersion() >= 0x03080000)
|
||||
return hleLogError(SCEKERNEL, SCE_KERNEL_ERROR_CAN_NOT_WAIT);
|
||||
PSPThread *thread = __GetCurrentThread();
|
||||
_dbg_assert_msg_(thread != NULL, "Exited from a NULL thread.");
|
||||
@@ -2185,7 +2185,7 @@ void _sceKernelExitThread(int exitStatus) {
|
||||
}
|
||||
|
||||
int sceKernelExitDeleteThread(int exitStatus) {
|
||||
if (!__KernelIsDispatchEnabled() && sceKernelGetCompiledSdkVersion() > 0x0307FFFF)
|
||||
if (!__KernelIsDispatchEnabled() && sceKernelGetCompiledSdkVersion() >= 0x03080000)
|
||||
return hleLogError(SCEKERNEL, SCE_KERNEL_ERROR_CAN_NOT_WAIT);
|
||||
PSPThread *thread = __GetCurrentThread();
|
||||
if (thread)
|
||||
@@ -2304,7 +2304,7 @@ int sceKernelTerminateDeleteThread(int threadID)
|
||||
ERROR_LOG(SCEKERNEL, "sceKernelTerminateDeleteThread(%i): cannot terminate current thread", threadID);
|
||||
return SCE_KERNEL_ERROR_ILLEGAL_THID;
|
||||
}
|
||||
if (!__KernelIsDispatchEnabled() && sceKernelGetCompiledSdkVersion() > 0x0307FFFF)
|
||||
if (!__KernelIsDispatchEnabled() && sceKernelGetCompiledSdkVersion() >= 0x03080000)
|
||||
return hleLogError(SCEKERNEL, SCE_KERNEL_ERROR_CAN_NOT_WAIT);
|
||||
|
||||
u32 error;
|
||||
@@ -2337,6 +2337,8 @@ int sceKernelTerminateThread(SceUID threadID) {
|
||||
if (__IsInInterrupt() && sceKernelGetCompiledSdkVersion() >= 0x03080000) {
|
||||
return hleLogError(SCEKERNEL, SCE_KERNEL_ERROR_ILLEGAL_CONTEXT, "in interrupt");
|
||||
}
|
||||
if (!__KernelIsDispatchEnabled() && sceKernelGetCompiledSdkVersion() >= 0x03080000)
|
||||
return hleLogError(SCEKERNEL, SCE_KERNEL_ERROR_CAN_NOT_WAIT);
|
||||
if (threadID == 0 || threadID == currentThread) {
|
||||
return hleLogError(SCEKERNEL, SCE_KERNEL_ERROR_ILLEGAL_THID, "cannot terminate current thread");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user