Skip to content

Commit

Permalink
Fixup for cpu_flag::pause state check after RPCS3#8114
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Apr 29, 2020
1 parent d66bdf1 commit 1b4c291
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
9 changes: 9 additions & 0 deletions rpcs3/Emu/Cell/PPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,16 @@ static T ppu_load_acquire_reservation(ppu_thread& ppu, u32 addr)
}
else
{
if (g_use_rtm)
{
ppu.state += cpu_flag::wait;
}

std::this_thread::yield();

if (ppu.test_stopped())
{
}
}
}())
{
Expand Down
21 changes: 15 additions & 6 deletions rpcs3/Emu/Cell/SPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1777,14 +1777,19 @@ 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);
u64 ntime;

for (u64 i = 0;; [&]()
{
if (is_paused())
if (state & cpu_flag::pause)
{
check_state();
}
Expand All @@ -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())
{
}
}
}())
{
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1b4c291

Please sign in to comment.