summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VideoConfig.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2024-06-02 16:45:30 +0200
committerJosJuice <josjuice@gmail.com>2024-06-21 20:52:55 +0200
commit72cf2bdb87f09deff22e1085de3290126aa4ad05 (patch)
treea3c399edfaa7ee17bf9b08cf95f2862a5d8edff9 /Source/Core/VideoCommon/VideoConfig.cpp
parent962230f91e06a60b2395de6f0974fdd213854d4c (diff)
Audit uses of IsRunning and GetState
Some pieces of code are calling IsRunning because there's some particular action that only makes sense when emulation is running, for instance showing the state of the emulated CPU. IsRunning is appropriate to use for this. Then there are pieces of code that are calling IsRunning because there's some particular thing they must avoid doing e.g. when the CPU thread is running or IOS is running. IsRunning isn't quite appropriate for this. Such code should also be checking for the states Starting and Stopping. Keep in mind that: * When the state is Starting, the state can asynchronously change to Running at any time. * When we try to stop the core, the state gets set to Stopping before we take any action to actually stop things. This commit adds a new method Core::IsUninitialized, and changes all callers of IsRunning and GetState that look to me like they should be changed.
Diffstat (limited to 'Source/Core/VideoCommon/VideoConfig.cpp')
-rw-r--r--Source/Core/VideoCommon/VideoConfig.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp
index efa159795c..0e2e3566ea 100644
--- a/Source/Core/VideoCommon/VideoConfig.cpp
+++ b/Source/Core/VideoCommon/VideoConfig.cpp
@@ -66,15 +66,12 @@ void VideoConfig::Refresh()
CPUThreadConfigCallback::AddConfigChangedCallback([]() {
auto& system = Core::System::GetInstance();
- const bool lock_gpu_thread = Core::IsRunning(system);
- if (lock_gpu_thread)
- system.GetFifo().PauseAndLock(true, false);
+ system.GetFifo().PauseAndLock(true, false);
g_Config.Refresh();
g_Config.VerifyValidity();
- if (lock_gpu_thread)
- system.GetFifo().PauseAndLock(false, true);
+ system.GetFifo().PauseAndLock(false, true);
});
s_has_registered_callback = true;
}