diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-09-10 03:37:29 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-10-09 18:30:31 +0200 |
commit | 555866f8dcb98897688d5d7b0e6c6cca55ac069f (patch) | |
tree | 287ffee685bd8fbd6a8a16aa02a198a6cab3ede3 /src/core/cpu_core_manager.cpp | |
parent | Merge pull request #2921 from FreddyFunk/compiler-warnings-core (diff) | |
download | yuzu-555866f8dcb98897688d5d7b0e6c6cca55ac069f.tar yuzu-555866f8dcb98897688d5d7b0e6c6cca55ac069f.tar.gz yuzu-555866f8dcb98897688d5d7b0e6c6cca55ac069f.tar.bz2 yuzu-555866f8dcb98897688d5d7b0e6c6cca55ac069f.tar.lz yuzu-555866f8dcb98897688d5d7b0e6c6cca55ac069f.tar.xz yuzu-555866f8dcb98897688d5d7b0e6c6cca55ac069f.tar.zst yuzu-555866f8dcb98897688d5d7b0e6c6cca55ac069f.zip |
Diffstat (limited to 'src/core/cpu_core_manager.cpp')
-rw-r--r-- | src/core/cpu_core_manager.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/core/cpu_core_manager.cpp b/src/core/cpu_core_manager.cpp index 8fcb4eeb1..e022e6a60 100644 --- a/src/core/cpu_core_manager.cpp +++ b/src/core/cpu_core_manager.cpp @@ -6,6 +6,7 @@ #include "core/arm/exclusive_monitor.h" #include "core/core.h" #include "core/core_cpu.h" +#include "core/core_timing.h" #include "core/cpu_core_manager.h" #include "core/gdbstub/gdbstub.h" #include "core/settings.h" @@ -122,13 +123,19 @@ void CpuCoreManager::RunLoop(bool tight_loop) { } } - for (active_core = 0; active_core < NUM_CPU_CORES; ++active_core) { - cores[active_core]->RunLoop(tight_loop); - if (Settings::values.use_multi_core) { - // Cores 1-3 are run on other threads in this mode - break; + auto& core_timing = system.CoreTiming(); + core_timing.ResetRun(); + bool keep_running{}; + do { + keep_running = false; + for (active_core = 0; active_core < NUM_CPU_CORES; ++active_core) { + core_timing.SwitchContext(active_core); + if (core_timing.CurrentContextCanRun()) { + cores[active_core]->RunLoop(tight_loop); + } + keep_running |= core_timing.CurrentContextCanRun(); } - } + } while (keep_running); if (GDBStub::IsServerEnabled()) { GDBStub::SetCpuStepFlag(false); |