diff options
author | Liam <byteslice@airmail.cc> | 2022-10-23 11:45:45 +0200 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2022-10-23 11:45:45 +0200 |
commit | 2d90a927c9f7652aa7e259ba57fa22ddbf8bed24 (patch) | |
tree | 031c7e8278dfea30bbbecd8a971ee4c2fc31feee /src/core/hle/kernel/kernel.cpp | |
parent | Merge pull request #9095 from FernandoS27/meat-good-vegetable-bad (diff) | |
download | yuzu-2d90a927c9f7652aa7e259ba57fa22ddbf8bed24.tar yuzu-2d90a927c9f7652aa7e259ba57fa22ddbf8bed24.tar.gz yuzu-2d90a927c9f7652aa7e259ba57fa22ddbf8bed24.tar.bz2 yuzu-2d90a927c9f7652aa7e259ba57fa22ddbf8bed24.tar.lz yuzu-2d90a927c9f7652aa7e259ba57fa22ddbf8bed24.tar.xz yuzu-2d90a927c9f7652aa7e259ba57fa22ddbf8bed24.tar.zst yuzu-2d90a927c9f7652aa7e259ba57fa22ddbf8bed24.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/kernel.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index eed2dc9f3..fdc774e30 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -48,8 +48,8 @@ namespace Kernel { struct KernelCore::Impl { explicit Impl(Core::System& system_, KernelCore& kernel_) - : time_manager{system_}, - service_threads_manager{1, "ServiceThreadsManager"}, system{system_} {} + : time_manager{system_}, service_threads_manager{1, "ServiceThreadsManager"}, + service_thread_barrier{2}, system{system_} {} void SetMulticore(bool is_multi) { is_multicore = is_multi; @@ -737,7 +737,12 @@ struct KernelCore::Impl { } void ClearServiceThreads() { - service_threads_manager.QueueWork([this]() { service_threads.clear(); }); + service_threads_manager.QueueWork([this] { + service_threads.clear(); + default_service_thread.reset(); + service_thread_barrier.Sync(); + }); + service_thread_barrier.Sync(); } std::mutex server_objects_lock; @@ -802,6 +807,7 @@ struct KernelCore::Impl { std::unordered_set<std::shared_ptr<ServiceThread>> service_threads; std::weak_ptr<ServiceThread> default_service_thread; Common::ThreadWorker service_threads_manager; + Common::Barrier service_thread_barrier; std::array<KThread*, Core::Hardware::NUM_CPU_CORES> shutdown_threads; std::array<std::unique_ptr<Kernel::KScheduler>, Core::Hardware::NUM_CPU_CORES> schedulers{}; |