mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 16:49:58 -06:00
Core::RunOnCPUThread: Avoid Global System Accessor
This commit is contained in:
@ -837,7 +837,7 @@ static bool PauseAndLock(Core::System& system, bool do_lock, bool unpause_on_unl
|
||||
return was_unpaused;
|
||||
}
|
||||
|
||||
void RunOnCPUThread(std::function<void()> function, bool wait_for_completion)
|
||||
void RunOnCPUThread(Core::System& system, std::function<void()> function, bool wait_for_completion)
|
||||
{
|
||||
// If the CPU thread is not running, assume there is no active CPU thread we can race against.
|
||||
if (!IsRunning() || IsCPUThread())
|
||||
@ -846,8 +846,6 @@ void RunOnCPUThread(std::function<void()> function, bool wait_for_completion)
|
||||
return;
|
||||
}
|
||||
|
||||
auto& system = Core::System::GetInstance();
|
||||
|
||||
// Pause the CPU (set it to stepping mode).
|
||||
const bool was_running = PauseAndLock(system, true, true);
|
||||
|
||||
|
Reference in New Issue
Block a user