From 5eb52c950dcc7d41fe545e09fe9c45b90fb323ef Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Mon, 22 Dec 2014 12:14:48 -0200 Subject: [PATCH] Thread: Convert waiting_threads list from Handle to pointers --- src/core/hle/kernel/thread.cpp | 6 ++---- src/core/hle/kernel/thread.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) 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;