diff options
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r-- | src/core/core.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 435ef6793..9e8936728 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -47,6 +47,7 @@ #include "core/hle/service/psc/time/system_clock.h" #include "core/hle/service/psc/time/time_zone_service.h" #include "core/hle/service/service.h" +#include "core/hle/service/services.h" #include "core/hle/service/set/system_settings_server.h" #include "core/hle/service/sm/sm.h" #include "core/internal_network/network.h" @@ -242,7 +243,7 @@ struct System::Impl { void Run() { std::unique_lock<std::mutex> lk(suspend_guard); - kernel.SuspendApplication(false); + kernel.SuspendEmulation(false); core_timing.SyncPause(false); is_paused.store(false, std::memory_order_relaxed); } @@ -251,7 +252,7 @@ struct System::Impl { std::unique_lock<std::mutex> lk(suspend_guard); core_timing.SyncPause(true); - kernel.SuspendApplication(true); + kernel.SuspendEmulation(true); is_paused.store(true, std::memory_order_relaxed); } @@ -261,7 +262,7 @@ struct System::Impl { std::unique_lock<std::mutex> StallApplication() { std::unique_lock<std::mutex> lk(suspend_guard); - kernel.SuspendApplication(true); + kernel.SuspendEmulation(true); core_timing.SyncPause(true); return lk; } @@ -269,7 +270,7 @@ struct System::Impl { void UnstallApplication() { if (!IsPaused()) { core_timing.SyncPause(false); - kernel.SuspendApplication(false); + kernel.SuspendEmulation(false); } } @@ -310,7 +311,8 @@ struct System::Impl { audio_core = std::make_unique<AudioCore::AudioCore>(system); service_manager = std::make_shared<Service::SM::ServiceManager>(kernel); - services = std::make_unique<Service::Services>(service_manager, system); + services = + std::make_unique<Service::Services>(service_manager, system, stop_event.get_token()); is_powered_on = true; exit_locked = false; @@ -458,11 +460,10 @@ struct System::Impl { gpu_core->NotifyShutdown(); } + stop_event.request_stop(); + core_timing.SyncPause(false); Network::CancelPendingSocketOperations(); - kernel.SuspendApplication(true); - if (services) { - services->KillNVNFlinger(); - } + kernel.SuspendEmulation(true); kernel.CloseServices(); kernel.ShutdownCores(); applet_manager.Reset(); @@ -480,6 +481,7 @@ struct System::Impl { cpu_manager.Shutdown(); debugger.reset(); kernel.Shutdown(); + stop_event = {}; Network::RestartSocketOperations(); if (auto room_member = room_network.GetRoomMember().lock()) { @@ -615,6 +617,7 @@ struct System::Impl { ExecuteProgramCallback execute_program_callback; ExitCallback exit_callback; + std::stop_source stop_event; std::array<u64, Core::Hardware::NUM_CPU_CORES> dynarmic_ticks{}; std::array<MicroProfileToken, Core::Hardware::NUM_CPU_CORES> microprofile_cpu{}; |