mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-12-25 19:02:45 -06:00
hle: kernel: service_thread: Ensure dummy thread is closed & destroyed on thread exit.
This commit is contained in:
parent
384e24d3e9
commit
0b37e7cb39
1 changed files with 5 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
||||||
#include "common/scope_exit.h"
|
#include "common/scope_exit.h"
|
||||||
#include "common/thread.h"
|
#include "common/thread.h"
|
||||||
#include "core/hle/kernel/k_session.h"
|
#include "core/hle/kernel/k_session.h"
|
||||||
|
#include "core/hle/kernel/k_thread.h"
|
||||||
#include "core/hle/kernel/kernel.h"
|
#include "core/hle/kernel/kernel.h"
|
||||||
#include "core/hle/kernel/service_thread.h"
|
#include "core/hle/kernel/service_thread.h"
|
||||||
|
|
||||||
|
@ -50,6 +51,10 @@ ServiceThread::Impl::Impl(KernelCore& kernel, std::size_t num_threads, const std
|
||||||
|
|
||||||
kernel.RegisterHostThread();
|
kernel.RegisterHostThread();
|
||||||
|
|
||||||
|
// Ensure the dummy thread allocated for this host thread is closed on exit.
|
||||||
|
auto* dummy_thread = kernel.GetCurrentEmuThread();
|
||||||
|
SCOPE_EXIT({ dummy_thread->Close(); });
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
std::function<void()> task;
|
std::function<void()> task;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue