summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
-rw-r--r--src/core/hle/kernel/thread.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index bc86a7c59..845672702 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -25,10 +25,7 @@ namespace Kernel {
25ResultVal<bool> Thread::WaitSynchronization() { 25ResultVal<bool> Thread::WaitSynchronization() {
26 const bool wait = status != THREADSTATUS_DORMANT; 26 const bool wait = status != THREADSTATUS_DORMANT;
27 if (wait) { 27 if (wait) {
28 Thread* thread = GetCurrentThread(); 28 AddWaitingThread(GetCurrentThread());
29 if (std::find(waiting_threads.begin(), waiting_threads.end(), thread) == waiting_threads.end()) {
30 waiting_threads.push_back(thread);
31 }
32 WaitCurrentThread(WAITTYPE_THREADEND, this); 29 WaitCurrentThread(WAITTYPE_THREADEND, this);
33 } 30 }
34 31
@@ -110,11 +107,7 @@ void Thread::Stop(const char* reason) {
110 107
111 ChangeReadyState(this, false); 108 ChangeReadyState(this, false);
112 status = THREADSTATUS_DORMANT; 109 status = THREADSTATUS_DORMANT;
113 for (auto& waiting_thread : waiting_threads) { 110 ResumeAllWaitingThreads();
114 if (CheckWaitType(waiting_thread.get(), WAITTYPE_THREADEND, this))
115 waiting_thread->ResumeFromWait();
116 }
117 waiting_threads.clear();
118 111
119 // Stopped threads are never waiting. 112 // Stopped threads are never waiting.
120 wait_type = WAITTYPE_NONE; 113 wait_type = WAITTYPE_NONE;