mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 15:01:28 +12:00
Atomic waiting refactoring (#9208)
* Use atomic waitables instead instead of global thread wait as often as possible. * Add ::is_stopped() and and ::is_paued() which can be used in atomic loops and with atomic wait. (constexpr cpu flags test functions) * Fix notification bug of sys_spu_thread_group_exit/terminate. (old bug, enhanced by #9117) * Function time statistics at Emu.Stop() restored. (instead of current "X syscall failed with 0x00000000 : 0")
This commit is contained in:
parent
cf384795d2
commit
f43260bd58
40 changed files with 375 additions and 234 deletions
|
@ -95,7 +95,7 @@ struct msg_dlg_thread_info
|
|||
|
||||
if (new_value == 0)
|
||||
{
|
||||
wait_until.wait(0);
|
||||
thread_ctrl::wait_on(wait_until, 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -217,14 +217,19 @@ error_code open_msg_dialog(bool is_blocking, u32 type, vm::cptr<char> msgString,
|
|||
lv2_obj::awake(&ppu);
|
||||
});
|
||||
|
||||
while (!ppu.state.test_and_reset(cpu_flag::signal))
|
||||
while (auto state = ppu.state.fetch_sub(cpu_flag::signal))
|
||||
{
|
||||
if (ppu.is_stopped())
|
||||
if (is_stopped(state))
|
||||
{
|
||||
return 0;
|
||||
return {};
|
||||
}
|
||||
|
||||
thread_ctrl::wait();
|
||||
if (state & cpu_flag::signal)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
thread_ctrl::wait_on(ppu.state, state);
|
||||
}
|
||||
|
||||
if (is_blocking)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue