diff options
| author | Dentomologist <dentomologist@gmail.com> | 2023-06-02 16:15:41 -0700 |
|---|---|---|
| committer | Dentomologist <dentomologist@gmail.com> | 2025-10-26 17:53:45 -0700 |
| commit | bebeba29c30e651156ba2ffe7717bd8ee4573be3 (patch) | |
| tree | 67f289e4ed8737beac714b5ed0c39af78b1ccae2 /Source | |
| parent | c22a483431bcc40a18250985426e0ae0c27bfa5a (diff) | |
CPU: Convert static variable to class member
Make s_have_fake_cpu_thread a class member instead. In addition to
getting rid of a bit of static state, this simplifies refactoring in an
upcoming commit.
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Core/HW/CPU.cpp | 8 | ||||
| -rw-r--r-- | Source/Core/Core/HW/CPU.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/Core/HW/CPU.cpp b/Source/Core/Core/HW/CPU.cpp index 82b0cb9c4b..fb9c89f902 100644 --- a/Source/Core/Core/HW/CPU.cpp +++ b/Source/Core/Core/HW/CPU.cpp @@ -353,8 +353,6 @@ void CPUManager::Continue() bool CPUManager::PauseAndLock(bool do_lock, bool unpause_on_unlock, bool control_adjacent) { - // NOTE: This is protected by m_stepping_lock. - static bool s_have_fake_cpu_thread = false; bool was_unpaused = false; if (do_lock) @@ -380,16 +378,16 @@ bool CPUManager::PauseAndLock(bool do_lock, bool unpause_on_unlock, bool control // depth counter instead of being a boolean. if (!Core::IsCPUThread()) { - s_have_fake_cpu_thread = true; + m_have_fake_cpu_thread = true; Core::DeclareAsCPUThread(); } } else { // Only need the stepping lock for this - if (s_have_fake_cpu_thread) + if (m_have_fake_cpu_thread) { - s_have_fake_cpu_thread = false; + m_have_fake_cpu_thread = false; Core::UndeclareAsCPUThread(); } diff --git a/Source/Core/Core/HW/CPU.h b/Source/Core/Core/HW/CPU.h index 438a48763b..13e915ba9a 100644 --- a/Source/Core/Core/HW/CPU.h +++ b/Source/Core/Core/HW/CPU.h @@ -122,6 +122,8 @@ private: // deadlock because of the order inversion. (A -> X,Y; B -> Y,X; A waits for // B, B waits for A) std::mutex m_stepping_lock; + // Protected by m_stepping_lock. + bool m_have_fake_cpu_thread = false; // Primary lock. Protects changing m_state, requesting instruction stepping and // pause-and-locking. |
