diff options
| author | 2015-01-17 02:03:44 -0500 | |
|---|---|---|
| committer | 2015-01-21 19:09:03 -0500 | |
| commit | 7faf2d8e06e705d1866fa0d7848ff43541a4b172 (patch) | |
| tree | 7cca6433c6b06a1299af1193df2cedac7ad522c5 /src/core/hle/kernel/mutex.cpp | |
| parent | Event: Fixed some bugs and cleanup (Subv) (diff) | |
| download | yuzu-7faf2d8e06e705d1866fa0d7848ff43541a4b172.tar.gz yuzu-7faf2d8e06e705d1866fa0d7848ff43541a4b172.tar.xz yuzu-7faf2d8e06e705d1866fa0d7848ff43541a4b172.zip | |
WaitSynchronizationN: Implement return values
Diffstat (limited to 'src/core/hle/kernel/mutex.cpp')
| -rw-r--r-- | src/core/hle/kernel/mutex.cpp | 8 |
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 | */ |
| 51 | void ResumeWaitingThread(Mutex* mutex) { | 51 | void 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 | ||
| 158 | ResultVal<bool> Mutex::WaitSynchronization() { | 158 | ResultVal<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; |