diff options
| author | 2020-12-03 22:26:42 -0800 | |
|---|---|---|
| committer | 2020-12-06 00:03:24 -0800 | |
| commit | ccce6cb3be062fc7ae162bed32202538ebc2e3d9 (patch) | |
| tree | 206612bfc3718371d2355c8e3447aba288b1828f /src/core/hle/kernel/mutex.cpp | |
| parent | hle: kernel: Separate KScopedSchedulerLockAndSleep from k_scheduler. (diff) | |
| download | yuzu-ccce6cb3be062fc7ae162bed32202538ebc2e3d9.tar.gz yuzu-ccce6cb3be062fc7ae162bed32202538ebc2e3d9.tar.xz yuzu-ccce6cb3be062fc7ae162bed32202538ebc2e3d9.zip | |
hle: kernel: Migrate to KScopedSchedulerLock.
Diffstat (limited to 'src/core/hle/kernel/mutex.cpp')
| -rw-r--r-- | src/core/hle/kernel/mutex.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index 6299b1342..4f8075e0e 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp | |||
| @@ -75,7 +75,7 @@ ResultCode Mutex::TryAcquire(VAddr address, Handle holding_thread_handle, | |||
| 75 | std::shared_ptr<Thread> current_thread = | 75 | std::shared_ptr<Thread> current_thread = |
| 76 | SharedFrom(kernel.CurrentScheduler()->GetCurrentThread()); | 76 | SharedFrom(kernel.CurrentScheduler()->GetCurrentThread()); |
| 77 | { | 77 | { |
| 78 | SchedulerLock lock(kernel); | 78 | KScopedSchedulerLock lock(kernel); |
| 79 | // The mutex address must be 4-byte aligned | 79 | // The mutex address must be 4-byte aligned |
| 80 | if ((address % sizeof(u32)) != 0) { | 80 | if ((address % sizeof(u32)) != 0) { |
| 81 | return ERR_INVALID_ADDRESS; | 81 | return ERR_INVALID_ADDRESS; |
| @@ -114,7 +114,7 @@ ResultCode Mutex::TryAcquire(VAddr address, Handle holding_thread_handle, | |||
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | { | 116 | { |
| 117 | SchedulerLock lock(kernel); | 117 | KScopedSchedulerLock lock(kernel); |
| 118 | auto* owner = current_thread->GetLockOwner(); | 118 | auto* owner = current_thread->GetLockOwner(); |
| 119 | if (owner != nullptr) { | 119 | if (owner != nullptr) { |
| 120 | owner->RemoveMutexWaiter(current_thread); | 120 | owner->RemoveMutexWaiter(current_thread); |
| @@ -153,7 +153,7 @@ std::pair<ResultCode, std::shared_ptr<Thread>> Mutex::Unlock(std::shared_ptr<Thr | |||
| 153 | 153 | ||
| 154 | ResultCode Mutex::Release(VAddr address) { | 154 | ResultCode Mutex::Release(VAddr address) { |
| 155 | auto& kernel = system.Kernel(); | 155 | auto& kernel = system.Kernel(); |
| 156 | SchedulerLock lock(kernel); | 156 | KScopedSchedulerLock lock(kernel); |
| 157 | 157 | ||
| 158 | std::shared_ptr<Thread> current_thread = | 158 | std::shared_ptr<Thread> current_thread = |
| 159 | SharedFrom(kernel.CurrentScheduler()->GetCurrentThread()); | 159 | SharedFrom(kernel.CurrentScheduler()->GetCurrentThread()); |