summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/thread.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-01-15 01:22:50 +0100
committerbunnei <bunneidev@gmail.com>2015-01-22 00:41:00 +0100
commitc22bac6398ff1705992fc44b2c29775c84cff662 (patch)
treee20da7e6e1824c19b7ced73f43815397749ffae7 /src/core/hle/kernel/thread.cpp
parentMerge pull request #491 from archshift/hidspvr (diff)
downloadyuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar
yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.gz
yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.bz2
yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.lz
yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.xz
yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.tar.zst
yuzu-c22bac6398ff1705992fc44b2c29775c84cff662.zip
Diffstat (limited to '')
-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 {
ResultVal<bool> Thread::WaitSynchronization() {
const bool wait = status != THREADSTATUS_DORMANT;
if (wait) {
- Thread* thread = GetCurrentThread();
- if (std::find(waiting_threads.begin(), waiting_threads.end(), thread) == waiting_threads.end()) {
- waiting_threads.push_back(thread);
- }
+ AddWaitingThread(GetCurrentThread());
WaitCurrentThread(WAITTYPE_THREADEND, this);
}
@@ -110,11 +107,7 @@ void Thread::Stop(const char* reason) {
ChangeReadyState(this, false);
status = THREADSTATUS_DORMANT;
- for (auto& waiting_thread : waiting_threads) {
- if (CheckWaitType(waiting_thread.get(), WAITTYPE_THREADEND, this))
- waiting_thread->ResumeFromWait();
- }
- waiting_threads.clear();
+ ResumeAllWaitingThreads();
// Stopped threads are never waiting.
wait_type = WAITTYPE_NONE;