Fixup for cpu_flag::pause state check after #8114

This commit is contained in:
Eladash 2020-04-29 05:24:28 +03:00
parent d66bdf1653
commit 954e3f6e6c
2 changed files with 17 additions and 6 deletions

View file

@ -1041,7 +1041,9 @@ static T ppu_load_acquire_reservation(ppu_thread& ppu, u32 addr)
}
else
{
ppu.state += cpu_flag::wait;
std::this_thread::yield();
ppu.check_state();
}
}())
{

View file

@ -1777,6 +1777,11 @@ bool spu_thread::process_mfc_cmd()
// Spinning, might as well yield cpu resources
std::this_thread::yield();
if (test_stopped())
{
return false;
}
}
auto& dst = _ref<decltype(rdata)>(ch_mfc_cmd.lsa & 0x3ff80);
@ -1784,7 +1789,7 @@ bool spu_thread::process_mfc_cmd()
for (u64 i = 0;; [&]()
{
if (is_paused())
if (state & cpu_flag::pause)
{
check_state();
}
@ -1795,7 +1800,16 @@ bool spu_thread::process_mfc_cmd()
}
else
{
if (g_use_rtm)
{
state += cpu_flag::wait;
}
std::this_thread::yield();
if (test_stopped())
{
}
}
}())
{
@ -1826,11 +1840,6 @@ bool spu_thread::process_mfc_cmd()
break;
}
if (test_stopped())
{
return false;
}
if (raddr && raddr != addr)
{
// Last check for event before we replace the reservation with a new one