diff options
author | bunnei <bunneidev@gmail.com> | 2023-01-26 03:42:18 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2023-06-03 09:05:28 +0200 |
commit | 104ff475d2557d295a4ef271d21a370392b6c568 (patch) | |
tree | 06569293d3dc00156c0a8c085c70896db2b824d5 /src | |
parent | android: jni: native: Tighten up emulation start/stop signaling. (diff) | |
download | yuzu-104ff475d2557d295a4ef271d21a370392b6c568.tar yuzu-104ff475d2557d295a4ef271d21a370392b6c568.tar.gz yuzu-104ff475d2557d295a4ef271d21a370392b6c568.tar.bz2 yuzu-104ff475d2557d295a4ef271d21a370392b6c568.tar.lz yuzu-104ff475d2557d295a4ef271d21a370392b6c568.tar.xz yuzu-104ff475d2557d295a4ef271d21a370392b6c568.tar.zst yuzu-104ff475d2557d295a4ef271d21a370392b6c568.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/android/app/src/main/jni/native.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index d0794e8b1..f1a70c35c 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp @@ -61,7 +61,7 @@ public: } bool IsRunning() const { - return is_running.load(std::memory_order_relaxed); + return is_running; } const Core::PerfStatsResults& PerfStats() const { @@ -125,14 +125,14 @@ public: } void HaltEmulation() { - is_running.store(false, std::memory_order_relaxed); + is_running = false; cv.notify_one(); } void RunEmulation() { std::unique_lock lock(mutex); - is_running.store(true, std::memory_order_relaxed); + is_running = true; void(system.Run()); @@ -140,8 +140,7 @@ public: system.InitializeDebugger(); } - while (!cv.wait_for(lock, std::chrono::seconds(1), - [&]() { return !is_running.load(std::memory_order_relaxed); })) { + while (!cv.wait_for(lock, std::chrono::seconds(1), [&]() { return !is_running; })) { std::scoped_lock perf_stats_lock(perf_stats_mutex); perf_stats = system.GetAndResetPerfStats(); } @@ -162,7 +161,7 @@ private: std::unique_ptr<EmuWindow_Android> window; std::mutex mutex; std::condition_variable_any cv; - std::atomic_bool is_running{}; + bool is_running{}; }; /*static*/ EmulationSession EmulationSession::s_instance; |