summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/mutex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/mutex.cpp')
-rw-r--r--src/core/hle/kernel/mutex.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp
index 35d829606..78063b8f1 100644
--- a/src/core/hle/kernel/mutex.cpp
+++ b/src/core/hle/kernel/mutex.cpp
@@ -26,7 +26,7 @@ public:
26 Handle lock_thread; ///< Handle to thread that currently has mutex 26 Handle lock_thread; ///< Handle to thread that currently has mutex
27 std::string name; ///< Name of mutex (optional) 27 std::string name; ///< Name of mutex (optional)
28 28
29 ResultVal<bool> WaitSynchronization() override; 29 ResultVal<bool> WaitSynchronization(unsigned index) override;
30}; 30};
31 31
32//////////////////////////////////////////////////////////////////////////////////////////////////// 32////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -50,7 +50,7 @@ void MutexAcquireLock(Mutex* mutex, Handle thread = GetCurrentThread()->GetHandl
50 */ 50 */
51void ResumeWaitingThread(Mutex* mutex) { 51void ResumeWaitingThread(Mutex* mutex) {
52 // Find the next waiting thread for the mutex... 52 // Find the next waiting thread for the mutex...
53 auto next_thread = mutex->ResumeNextThread(); 53 auto next_thread = mutex->ReleaseNextThread();
54 if (next_thread != nullptr) { 54 if (next_thread != nullptr) {
55 MutexAcquireLock(mutex, next_thread->GetHandle()); 55 MutexAcquireLock(mutex, next_thread->GetHandle());
56 } else { 56 } else {
@@ -155,11 +155,11 @@ Handle CreateMutex(bool initial_locked, const std::string& name) {
155 return handle; 155 return handle;
156} 156}
157 157
158ResultVal<bool> Mutex::WaitSynchronization() { 158ResultVal<bool> Mutex::WaitSynchronization(unsigned index) {
159 bool wait = locked; 159 bool wait = locked;
160 if (locked) { 160 if (locked) {
161 AddWaitingThread(GetCurrentThread()); 161 AddWaitingThread(GetCurrentThread());
162 Kernel::WaitCurrentThread(WAITTYPE_MUTEX, this); 162 Kernel::WaitCurrentThread_WaitSynchronization(WAITTYPE_MUTEX, this, index);
163 } else { 163 } else {
164 // Lock the mutex when the first thread accesses it 164 // Lock the mutex when the first thread accesses it
165 locked = true; 165 locked = true;