Procházet zdrojové kódy

hle: kernel: service_thread: Force stop threads on destruction.

bunnei před 4 roky
rodič
revize
d7f6d516ce
1 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 7 1
      src/core/hle/kernel/service_thread.cpp

+ 7 - 1
src/core/hle/kernel/service_thread.cpp

@@ -97,7 +97,13 @@ void ServiceThread::Impl::QueueSyncRequest(KSession& session,
     condition.notify_one();
 }
 
-ServiceThread::Impl::~Impl() = default;
+ServiceThread::Impl::~Impl() {
+    condition.notify_all();
+    for (auto& thread : threads) {
+        thread.request_stop();
+        thread.join();
+    }
+}
 
 ServiceThread::ServiceThread(KernelCore& kernel, std::size_t num_threads, const std::string& name)
     : impl{std::make_unique<Impl>(kernel, num_threads, name)} {}