MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / sys_ppu_thread_start

Function sys_ppu_thread_start

kernel/cellos/src/sys_ppu_thread.cpp:528–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526}
527
528error_code sys_ppu_thread_start(ppu_thread &ppu, u32 thread_id) {
529 ppu.state += cpu_flag::wait;
530
531 sys_ppu_thread.trace("sys_ppu_thread_start(thread_id=0x%x)", thread_id);
532
533 const auto thread = idm::get<named_thread<ppu_thread>>(
534 thread_id,
535 [&, notify = lv2_obj::notify_all_t()](ppu_thread &thread) -> CellError {
536 if (!thread.state.test_and_reset(cpu_flag::stop)) {
537 // Already started
538 return CELL_EBUSY;
539 }
540
541 ensure(lv2_obj::awake(&thread));
542
543 thread.cmd_list({
544 {ppu_cmd::entry_call, 0},
545 });
546
547 return {};
548 });
549
550 if (!thread) {
551 return CELL_ESRCH;
552 }
553
554 if (thread.ret) {
555 return thread.ret;
556 } else {
557 thread->cmd_notify.store(1);
558 thread->cmd_notify.notify_one();
559 }
560
561 return CELL_OK;
562}
563
564error_code sys_ppu_thread_rename(ppu_thread &ppu, u32 thread_id,
565 vm::cptr<char> name) {

Callers 1

sys_ppu_thread_createFunction · 0.85

Calls 6

notify_all_tClass · 0.85
cmd_listMethod · 0.80
ensureFunction · 0.50
test_and_resetMethod · 0.45
storeMethod · 0.45
notify_oneMethod · 0.45

Tested by

no test coverage detected