diff options
Diffstat (limited to 'src/yuzu')
| -rw-r--r-- | src/yuzu/bootmanager.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/bootmanager.h | 7 | 
2 files changed, 5 insertions, 8 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index cc6b6a25a..bdd1497b5 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -105,14 +105,12 @@ void EmuThread::run() {          std::unique_lock lk{m_should_run_mutex};          if (m_should_run) {              m_system.Run(); -            m_is_running.store(true); -            m_is_running.notify_all(); +            m_stopped.Reset();              Common::CondvarWait(m_should_run_cv, lk, stop_token, [&] { return !m_should_run; });          } else {              m_system.Pause(); -            m_is_running.store(false); -            m_is_running.notify_all(); +            m_stopped.Set();              EmulationPaused(lk);              Common::CondvarWait(m_should_run_cv, lk, stop_token, [&] { return m_should_run; }); diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h index b7b9d4141..87b23df12 100644 --- a/src/yuzu/bootmanager.h +++ b/src/yuzu/bootmanager.h @@ -3,7 +3,6 @@  #pragma once -#include <atomic>  #include <condition_variable>  #include <cstddef>  #include <memory> @@ -88,7 +87,7 @@ public:          // Wait until paused, if pausing.          if (!should_run) { -            m_is_running.wait(true); +            m_stopped.Wait();          }      } @@ -97,7 +96,7 @@ public:       * @return True if the emulation thread is running, otherwise false       */      bool IsRunning() const { -        return m_is_running.load() || m_should_run; +        return m_should_run;      }      /** @@ -118,7 +117,7 @@ private:      std::stop_source m_stop_source;      std::mutex m_should_run_mutex;      std::condition_variable_any m_should_run_cv; -    std::atomic<bool> m_is_running{false}; +    Common::Event m_stopped;      bool m_should_run{true};  signals:  | 
