aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/kernel/mutex.cpp
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2015-01-17 02:03:44 -0500
committerGravatar bunnei <bunneidev@gmail.com>2015-01-21 19:09:03 -0500
commit7faf2d8e06e705d1866fa0d7848ff43541a4b172 (patch)
tree7cca6433c6b06a1299af1193df2cedac7ad522c5 /src/core/hle/kernel/mutex.cpp
parente4a5d8ad4f708c9674c9865eb872e3c081d9a8c8 (diff)
WaitSynchronizationN: Implement return values
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 35d82960..78063b8f 100644
--- a/src/core/hle/kernel/mutex.cpp
+++ b/src/core/hle/kernel/mutex.cpp
@@ -26,7 +26,7 @@ public:
Handle lock_thread; ///< Handle to thread that currently has mutex
std::string name; ///< Name of mutex (optional)
- ResultVal<bool> WaitSynchronization() override;
+ ResultVal<bool> WaitSynchronization(unsigned index) override;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -50,7 +50,7 @@ void MutexAcquireLock(Mutex* mutex, Handle thread = GetCurrentThread()->GetHandl
*/
void ResumeWaitingThread(Mutex* mutex) {
// Find the next waiting thread for the mutex...
- auto next_thread = mutex->ResumeNextThread();
+ auto next_thread = mutex->ReleaseNextThread();
if (next_thread != nullptr) {
MutexAcquireLock(mutex, next_thread->GetHandle());
} else {
@@ -155,11 +155,11 @@ Handle CreateMutex(bool initial_locked, const std::string& name) {
return handle;
}
-ResultVal<bool> Mutex::WaitSynchronization() {
+ResultVal<bool> Mutex::WaitSynchronization(unsigned index) {
bool wait = locked;
if (locked) {
AddWaitingThread(GetCurrentThread());
- Kernel::WaitCurrentThread(WAITTYPE_MUTEX, this);
+ Kernel::WaitCurrentThread_WaitSynchronization(WAITTYPE_MUTEX, this, index);
} else {
// Lock the mutex when the first thread accesses it
locked = true;