diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-10-16 00:20:19 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-10-16 00:23:27 +0200 |
commit | 53cf91d151d1e3d289917b63cf17ca254674f1ce (patch) | |
tree | b98a87d68243e1f9358c10a8870dd296c0aa5eb1 /src/core/core.cpp | |
parent | Suspend temporally (diff) | |
download | yuzu-53cf91d151d1e3d289917b63cf17ca254674f1ce.tar yuzu-53cf91d151d1e3d289917b63cf17ca254674f1ce.tar.gz yuzu-53cf91d151d1e3d289917b63cf17ca254674f1ce.tar.bz2 yuzu-53cf91d151d1e3d289917b63cf17ca254674f1ce.tar.lz yuzu-53cf91d151d1e3d289917b63cf17ca254674f1ce.tar.xz yuzu-53cf91d151d1e3d289917b63cf17ca254674f1ce.tar.zst yuzu-53cf91d151d1e3d289917b63cf17ca254674f1ce.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/core.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 4abf037e2..3042d611b 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -163,19 +163,19 @@ struct System::Impl { return status; } - void stallForGPU(bool pause) { - if (pause) { - suspend_guard.lock(); - kernel.Suspend(pause); - core_timing.SyncPause(pause); - cpu_manager.Pause(pause); - } else { - if (!is_paused) { - core_timing.SyncPause(pause); - kernel.Suspend(pause); - cpu_manager.Pause(pause); - } - suspend_guard.unlock(); + std::unique_lock<std::mutex> StallCPU() { + std::unique_lock<std::mutex> lk(suspend_guard); + kernel.Suspend(true); + core_timing.SyncPause(true); + cpu_manager.Pause(true); + return lk; + } + + void UnstallCPU() { + if (!is_paused) { + core_timing.SyncPause(false); + kernel.Suspend(false); + cpu_manager.Pause(false); } } @@ -487,8 +487,12 @@ void System::Shutdown() { impl->Shutdown(); } -void System::stallForGPU(bool pause) { - impl->stallForGPU(pause); +std::unique_lock<std::mutex> System::StallCPU() { + return impl->StallCPU(); +} + +void System::UnstallCPU() { + impl->UnstallCPU(); } SystemResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath, |