diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index cacfc7b81..f943cc442 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -24,7 +24,7 @@ namespace Kernel { ResultVal Thread::WaitSynchronization() { const bool wait = status != THREADSTATUS_DORMANT; if (wait) { - Handle thread = GetCurrentThread()->GetHandle(); + Thread* thread = GetCurrentThread(); if (std::find(waiting_threads.begin(), waiting_threads.end(), thread) == waiting_threads.end()) { waiting_threads.push_back(thread); } @@ -125,9 +125,7 @@ void Thread::Stop(const char* reason) { ChangeReadyState(this, false); status = THREADSTATUS_DORMANT; - for (Handle waiting_handle : waiting_threads) { - Thread* waiting_thread = g_handle_table.Get(waiting_handle); - + for (Thread* waiting_thread : waiting_threads) { if (CheckWaitType(waiting_thread, WAITTYPE_THREADEND, GetHandle())) waiting_thread->ResumeFromWait(); } diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index b589e7ba4..6bd60677b 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h @@ -97,7 +97,7 @@ public: Handle wait_handle; VAddr wait_address; - std::vector waiting_threads; + std::vector waiting_threads; // TODO(yuriks): Owned std::string name;