diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index 017562955f..5946ae12c9 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -52,11 +52,12 @@ void ThreadBase::Start() }); } -void ThreadBase::Stop(bool wait) +void ThreadBase::Stop(bool wait, bool send_destroy) { std::lock_guard lock(m_main_mutex); - m_destroy = true; + if (send_destroy) + m_destroy = true; if(!m_executor) return; diff --git a/Utilities/Thread.h b/Utilities/Thread.h index f8967bbc3a..46b4470574 100644 --- a/Utilities/Thread.h +++ b/Utilities/Thread.h @@ -41,7 +41,7 @@ protected: public: void Start(); - void Stop(bool wait = true); + void Stop(bool wait = true, bool send_destroy = true); bool Join() const; bool IsAlive() const; diff --git a/rpcs3/Emu/CPU/CPUThread.cpp b/rpcs3/Emu/CPU/CPUThread.cpp index 8942295a46..1db69cb128 100644 --- a/rpcs3/Emu/CPU/CPUThread.cpp +++ b/rpcs3/Emu/CPU/CPUThread.cpp @@ -284,8 +284,10 @@ void CPUThread::ExecOnce() #ifndef QT_UI wxGetApp().SendDbgCommand(DID_EXEC_THREAD, this); #endif + m_status = Running; ThreadBase::Start(); - ThreadBase::Stop(); + ThreadBase::Stop(true,false); + m_status = Paused; #ifndef QT_UI wxGetApp().SendDbgCommand(DID_PAUSE_THREAD, this); wxGetApp().SendDbgCommand(DID_PAUSED_THREAD, this);