fix thread exit crash

This commit is contained in:
elisha464 2014-01-23 21:37:59 +02:00
parent 64bfae6648
commit 8a3835bcef
3 changed files with 8 additions and 3 deletions

View file

@ -351,6 +351,11 @@ void CPUThread::Task()
{ {
ConLog.Error("Exception: %s", e); ConLog.Error("Exception: %s", e);
} }
catch(int exitcode)
{
ConLog.Success("Exit Code: %d", exitcode);
return;
}
//ConLog.Write("%s leave", CPUThread::GetFName()); //ConLog.Write("%s leave", CPUThread::GetFName());

View file

@ -169,7 +169,7 @@ extern int sys_mutex_trylock(u32 mutex_id);
extern int sys_mutex_unlock(u32 mutex_id); extern int sys_mutex_unlock(u32 mutex_id);
//ppu_thread //ppu_thread
extern int sys_ppu_thread_exit(int errorcode); extern void sys_ppu_thread_exit(int errorcode);
extern int sys_ppu_thread_yield(); extern int sys_ppu_thread_yield();
extern int sys_ppu_thread_join(u32 thread_id, u32 vptr_addr); extern int sys_ppu_thread_join(u32 thread_id, u32 vptr_addr);
extern int sys_ppu_thread_detach(u32 thread_id); extern int sys_ppu_thread_detach(u32 thread_id);

View file

@ -10,7 +10,7 @@ enum
SYS_PPU_THREAD_DONE_INIT, SYS_PPU_THREAD_DONE_INIT,
}; };
int sys_ppu_thread_exit(int errorcode) void sys_ppu_thread_exit(int errorcode)
{ {
if(errorcode == 0) if(errorcode == 0)
{ {
@ -25,7 +25,7 @@ int sys_ppu_thread_exit(int errorcode)
thr.SetExitStatus(errorcode); thr.SetExitStatus(errorcode);
Emu.GetCPU().RemoveThread(thr.GetId()); Emu.GetCPU().RemoveThread(thr.GetId());
return CELL_OK; throw errorcode;
} }
int sys_ppu_thread_yield() int sys_ppu_thread_yield()