diff options
| author | 2021-12-05 23:42:58 -0800 | |
|---|---|---|
| committer | 2021-12-06 16:39:18 -0800 | |
| commit | d7f6d516cefed79dea14465abd7c2a0f036f78b9 (patch) | |
| tree | 786e9bfb73b0c17aa4f0e93cc5ea07f1619a5705 /src | |
| parent | hle: kernel: k_light_lock: Implement CancelWait. (diff) | |
| download | yuzu-d7f6d516cefed79dea14465abd7c2a0f036f78b9.tar.gz yuzu-d7f6d516cefed79dea14465abd7c2a0f036f78b9.tar.xz yuzu-d7f6d516cefed79dea14465abd7c2a0f036f78b9.zip | |
hle: kernel: service_thread: Force stop threads on destruction.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/service_thread.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/hle/kernel/service_thread.cpp b/src/core/hle/kernel/service_thread.cpp index 00657bc4c..03f3dec10 100644 --- a/src/core/hle/kernel/service_thread.cpp +++ b/src/core/hle/kernel/service_thread.cpp | |||
| @@ -97,7 +97,13 @@ void ServiceThread::Impl::QueueSyncRequest(KSession& session, | |||
| 97 | condition.notify_one(); | 97 | condition.notify_one(); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | ServiceThread::Impl::~Impl() = default; | 100 | ServiceThread::Impl::~Impl() { |
| 101 | condition.notify_all(); | ||
| 102 | for (auto& thread : threads) { | ||
| 103 | thread.request_stop(); | ||
| 104 | thread.join(); | ||
| 105 | } | ||
| 106 | } | ||
| 101 | 107 | ||
| 102 | ServiceThread::ServiceThread(KernelCore& kernel, std::size_t num_threads, const std::string& name) | 108 | ServiceThread::ServiceThread(KernelCore& kernel, std::size_t num_threads, const std::string& name) |
| 103 | : impl{std::make_unique<Impl>(kernel, num_threads, name)} {} | 109 | : impl{std::make_unique<Impl>(kernel, num_threads, name)} {} |