| 1453 | } |
| 1454 | |
| 1455 | stx::reset_lock acquire_reset_lock(stx::init_mutex &mtx, ppu_thread *ppu) { |
| 1456 | if (!ppu) { |
| 1457 | ppu = ensure(cpu_thread::get_current<ppu_thread>()); |
| 1458 | } |
| 1459 | |
| 1460 | return mtx.reset( |
| 1461 | [](int invoke_count, const stx::init_lock &, ppu_thread *ppu) { |
| 1462 | if (!invoke_count) { |
| 1463 | // Sleep before waiting on lock |
| 1464 | lv2_obj::sleep(*ppu); |
| 1465 | } else { |
| 1466 | // Wake up after acquistion or failure to acquire |
| 1467 | ppu->check_state(); |
| 1468 | } |
| 1469 | }, |
| 1470 | ppu); |
| 1471 | } |
| 1472 | |
| 1473 | class ppu_syscall_usage { |
| 1474 | // Internal buffer |
no test coverage detected