summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2016-12-10 19:29:31 +0100
committerSubv <subv2112@gmail.com>2016-12-10 19:29:31 +0100
commit406907d57055965780e04769482556995de8c50a (patch)
treef9e355eccba394047b32160e8f7574a74f46772b /src/core/hle/kernel/kernel.cpp
parentWaitSynch: Removed unused variables and reduced SharedPtr copies. (diff)
downloadyuzu-406907d57055965780e04769482556995de8c50a.tar
yuzu-406907d57055965780e04769482556995de8c50a.tar.gz
yuzu-406907d57055965780e04769482556995de8c50a.tar.bz2
yuzu-406907d57055965780e04769482556995de8c50a.tar.lz
yuzu-406907d57055965780e04769482556995de8c50a.tar.xz
yuzu-406907d57055965780e04769482556995de8c50a.tar.zst
yuzu-406907d57055965780e04769482556995de8c50a.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/kernel.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 653697843..2ddeffcdd 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -38,6 +38,11 @@ SharedPtr<Thread> WaitObject::GetHighestPriorityReadyThread() {
return thread->status == THREADSTATUS_RUNNING || thread->status == THREADSTATUS_READY;
});
+ // TODO(Subv): This call should be performed inside the loop below to check if an object can be
+ // acquired by a particular thread. This is useful for things like recursive locking of Mutexes.
+ if (ShouldWait())
+ return nullptr;
+
Thread* candidate = nullptr;
s32 candidate_priority = THREADPRIO_LOWEST + 1;
@@ -67,7 +72,7 @@ void WaitObject::WakeupAllWaitingThreads() {
thread->wait_set_output = false;
}
} else {
- for (auto object : thread->wait_objects) {
+ for (auto& object : thread->wait_objects) {
object->Acquire();
object->RemoveWaitingThread(thread.get());
}