mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2024-11-22 16:05:36 +01:00
android: Separate emulation states from emulation mutex
Emulation states are repeatedly checked by input and performance stats. During startup and shutdown, this could lead to a long halt on the UI thread because the call to IsRunning will be waiting on the emulation mutex to be unlocked. Using atomics should replace the existing functionality without causing problems.
This commit is contained in:
parent
b0a96d5216
commit
5445e974e0
@ -203,12 +203,10 @@ public:
|
||||
}
|
||||
|
||||
bool IsRunning() const {
|
||||
std::scoped_lock lock(m_mutex);
|
||||
return m_is_running;
|
||||
}
|
||||
|
||||
bool IsPaused() const {
|
||||
std::scoped_lock lock(m_mutex);
|
||||
return m_is_running && m_is_paused;
|
||||
}
|
||||
|
||||
@ -544,8 +542,8 @@ private:
|
||||
Core::PerfStatsResults m_perf_stats{};
|
||||
std::shared_ptr<FileSys::VfsFilesystem> m_vfs;
|
||||
Core::SystemResultStatus m_load_result{Core::SystemResultStatus::ErrorNotInitialized};
|
||||
bool m_is_running{};
|
||||
bool m_is_paused{};
|
||||
std::atomic<bool> m_is_running = false;
|
||||
std::atomic<bool> m_is_paused = false;
|
||||
SoftwareKeyboard::AndroidKeyboard* m_software_keyboard{};
|
||||
std::unique_ptr<Service::Account::ProfileManager> m_profile_manager;
|
||||
std::unique_ptr<FileSys::ManualContentProvider> m_manual_provider;
|
||||
|
Loading…
Reference in New Issue
Block a user