Fix sys_ppu_thread_start error checking, fix rare bug in sys_ppu_thread_create

* Correct error code to EBUSY.
* lv2_obj::awake was called even when EBSUY should be returned.
* Fix sys_ppu_thread_create for a newly created thread with the same id as ppu_thread::id_base. (can happen if main thread exited before its creation)
This commit is contained in:
Eladash 2020-04-29 08:03:07 +03:00
parent c1dc6838fa
commit dd6825a7bd
3 changed files with 23 additions and 15 deletions

View file

@ -15,7 +15,7 @@ void lv2_int_serv::exec()
({
{ ppu_cmd::reset_stack, 0 },
{ ppu_cmd::set_args, 2 }, arg1, arg2,
{ ppu_cmd::opd_call, 0 }, std::bit_cast<u64>(thread->entry_func),
{ ppu_cmd::opd_call, 0 }, thread->entry_func,
{ ppu_cmd::sleep, 0 }
});