Skip to content

Commit

Permalink
Debugger: Simplify thread pause state change
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Oct 22, 2020
1 parent 5430f03 commit 07be04a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions rpcs3/rpcs3qt/debugger_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,13 @@ debugger_frame::debugger_frame(std::shared_ptr<gui_settings> settings, QWidget *
{
if (const auto cpu = this->cpu.lock())
{
if (m_btn_run->text() == RunString && cpu->state.test_and_reset(cpu_flag::dbg_pause))
{
if (!(cpu->state & (cpu_flag::dbg_pause + cpu_flag::dbg_global_pause)))
{
cpu->notify();
}
}
else
// Alter dbg_pause bit state (disable->enable, enable->disable)
auto old = cpu->state.xor_fetch(cpu_flag::dbg_pause);

// Notify only if no pause flags are set after this change
if (!(old & (cpu_flag::dbg_pause + cpu_flag::dbg_global_pause)))
{
cpu->state += cpu_flag::dbg_pause;
cpu->notify();
}
}
UpdateUI();
Expand Down

0 comments on commit 07be04a

Please sign in to comment.