diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-03-19 18:09:32 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-06-27 17:35:52 +0200 |
commit | f2ade343e2492c213ac93680a55e9bed712dac9a (patch) | |
tree | 30bce0eb24a0b2b38310f07fa37c7ba881fc8535 /src/core/core_timing.cpp | |
parent | GUI: Make multicore only work with Async and add GUI for multicore. (diff) | |
download | yuzu-f2ade343e2492c213ac93680a55e9bed712dac9a.tar yuzu-f2ade343e2492c213ac93680a55e9bed712dac9a.tar.gz yuzu-f2ade343e2492c213ac93680a55e9bed712dac9a.tar.bz2 yuzu-f2ade343e2492c213ac93680a55e9bed712dac9a.tar.lz yuzu-f2ade343e2492c213ac93680a55e9bed712dac9a.tar.xz yuzu-f2ade343e2492c213ac93680a55e9bed712dac9a.tar.zst yuzu-f2ade343e2492c213ac93680a55e9bed712dac9a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/core_timing.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 3438f79ce..189d4aa34 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -55,7 +55,9 @@ void CoreTiming::Initialize(std::function<void(void)>&& on_thread_init_) { event_fifo_id = 0; const auto empty_timed_callback = [](u64, s64) {}; ev_lost = CreateEvent("_lost_event", empty_timed_callback); - timer_thread = std::make_unique<std::thread>(ThreadEntry, std::ref(*this)); + if (is_multicore) { + timer_thread = std::make_unique<std::thread>(ThreadEntry, std::ref(*this)); + } } void CoreTiming::Shutdown() { @@ -63,7 +65,9 @@ void CoreTiming::Shutdown() { shutting_down = true; pause_event.Set(); event.Set(); - timer_thread->join(); + if (timer_thread) { + timer_thread->join(); + } ClearPendingEvents(); timer_thread.reset(); has_started = false; @@ -78,12 +82,14 @@ void CoreTiming::SyncPause(bool is_paused) { return; } Pause(is_paused); - if (!is_paused) { - pause_event.Set(); + if (timer_thread) { + if (!is_paused) { + pause_event.Set(); + } + event.Set(); + while (paused_set != is_paused) + ; } - event.Set(); - while (paused_set != is_paused) - ; } bool CoreTiming::IsRunning() const { |