summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-01-19 02:59:54 +0100
committerbunnei <bunneidev@gmail.com>2022-01-21 02:08:00 +0100
commitf6815086a163029771cad51713601df93738d393 (patch)
tree8c74b29407a1f5aea4481f2a1885ffeab43b10d5
parenthle: kernel: KThread: DummyThread can be waited, ensure wait_queue is not nullptr. (diff)
downloadyuzu-f6815086a163029771cad51713601df93738d393.tar
yuzu-f6815086a163029771cad51713601df93738d393.tar.gz
yuzu-f6815086a163029771cad51713601df93738d393.tar.bz2
yuzu-f6815086a163029771cad51713601df93738d393.tar.lz
yuzu-f6815086a163029771cad51713601df93738d393.tar.xz
yuzu-f6815086a163029771cad51713601df93738d393.tar.zst
yuzu-f6815086a163029771cad51713601df93738d393.zip
-rw-r--r--src/core/hle/kernel/kernel.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 887c1fd27..49c0714ed 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -301,12 +301,10 @@ struct KernelCore::Impl {
// Gets the dummy KThread for the caller, allocating a new one if this is the first time
KThread* GetHostDummyThread() {
auto make_thread = [this]() {
- std::lock_guard lk(dummy_thread_lock);
- auto& thread = dummy_threads.emplace_back(std::make_unique<KThread>(system.Kernel()));
- KAutoObject::Create(thread.get());
- ASSERT(KThread::InitializeDummyThread(thread.get()).IsSuccess());
+ KThread* thread = KThread::Create(system.Kernel());
+ ASSERT(KThread::InitializeDummyThread(thread).IsSuccess());
thread->SetName(fmt::format("DummyThread:{}", GetHostThreadId()));
- return thread.get();
+ return thread;
};
thread_local KThread* saved_thread = make_thread();
@@ -731,7 +729,6 @@ struct KernelCore::Impl {
std::mutex server_sessions_lock;
std::mutex registered_objects_lock;
std::mutex registered_in_use_objects_lock;
- std::mutex dummy_thread_lock;
std::atomic<u32> next_object_id{0};
std::atomic<u64> next_kernel_process_id{KProcess::InitialKIPIDMin};
@@ -788,9 +785,6 @@ struct KernelCore::Impl {
std::array<Core::CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES> interrupts{};
std::array<std::unique_ptr<Kernel::KScheduler>, Core::Hardware::NUM_CPU_CORES> schedulers{};
- // Specifically tracked to be automatically destroyed with kernel
- std::vector<std::unique_ptr<KThread>> dummy_threads;
-
bool is_multicore{};
std::atomic_bool is_shutting_down{};
bool is_phantom_mode_for_singlecore{};