Fix properly RSX replay thread stop bug

This commit is contained in:
Eladash 2023-06-19 10:49:59 +03:00 committed by Megamouse
parent aff871f127
commit 4f5348c7d4
3 changed files with 23 additions and 15 deletions

View file

@ -48,6 +48,17 @@ static void set_rsx_dmactl(rsx::thread* render, u64 get_put)
// Unconditional set
while (!render->new_get_put.compare_and_swap_test(u64{umax}, get_put))
{
// Wait for the first store to complete (or be aborted)
if (auto cpu = cpu_thread::get_current())
{
if (cpu->state & cpu_flag::exit)
{
// Retry
cpu->state += cpu_flag::again;
return;
}
}
utils::pause();
}
@ -60,12 +71,13 @@ static void set_rsx_dmactl(rsx::thread* render, u64 get_put)
// Wait for the first store to complete (or be aborted)
while (render->new_get_put != usz{umax})
{
if (Emu.IsStopped())
if (cpu->state & cpu_flag::exit)
{
if (render->new_get_put.compare_and_swap_test(get_put, umax))
{
// Retry
cpu->state += cpu_flag::again;
return;
}
}