sys_semaphore: add state check to sys_semaphore_get_value

Also to sys_semaphore_create, although we don't do it.
This commit is contained in:
Nekotekina 2020-11-08 19:03:41 +03:00
parent 8bc9868c1f
commit 733b46d51a

View file

@ -46,6 +46,11 @@ error_code sys_semaphore_create(ppu_thread& ppu, vm::ptr<u32> sem_id, vm::ptr<sy
return error; return error;
} }
if (ppu.test_stopped())
{
return {};
}
*sem_id = idm::last_id(); *sem_id = idm::last_id();
return CELL_OK; return CELL_OK;
} }
@ -283,6 +288,11 @@ error_code sys_semaphore_get_value(ppu_thread& ppu, u32 sem_id, vm::ptr<s32> cou
return CELL_EFAULT; return CELL_EFAULT;
} }
if (ppu.test_stopped())
{
return {};
}
*count = sema.ret; *count = sema.ret;
return CELL_OK; return CELL_OK;
} }