From c4ba088a5df13ff4b4d8853216231d690f2c79c0 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 23 Feb 2023 15:49:42 -0500 Subject: kernel: refactor priority inheritance to represent locks as C++ objects --- src/core/hle/kernel/k_light_lock.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/hle/kernel/k_light_lock.cpp') diff --git a/src/core/hle/kernel/k_light_lock.cpp b/src/core/hle/kernel/k_light_lock.cpp index d791acbe3..b922a67a5 100644 --- a/src/core/hle/kernel/k_light_lock.cpp +++ b/src/core/hle/kernel/k_light_lock.cpp @@ -90,15 +90,15 @@ void KLightLock::UnlockSlowPath(uintptr_t _cur_thread) { KScopedSchedulerLock sl(kernel); // Get the next owner. - s32 num_waiters; + bool has_waiters; KThread* next_owner = owner_thread->RemoveWaiterByKey( - std::addressof(num_waiters), reinterpret_cast(std::addressof(tag))); + std::addressof(has_waiters), reinterpret_cast(std::addressof(tag))); // Pass the lock to the next owner. uintptr_t next_tag = 0; if (next_owner != nullptr) { next_tag = - reinterpret_cast(next_owner) | static_cast(num_waiters > 1); + reinterpret_cast(next_owner) | static_cast(has_waiters); next_owner->EndWait(ResultSuccess); -- cgit v1.2.3 From 97f7f7bad59cdd42bf5f504089e5cecd441da3ce Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 23 Feb 2023 20:32:03 -0500 Subject: kernel: be more careful about kernel address keys --- src/core/hle/kernel/k_light_lock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/hle/kernel/k_light_lock.cpp') diff --git a/src/core/hle/kernel/k_light_lock.cpp b/src/core/hle/kernel/k_light_lock.cpp index b922a67a5..14cb615da 100644 --- a/src/core/hle/kernel/k_light_lock.cpp +++ b/src/core/hle/kernel/k_light_lock.cpp @@ -91,7 +91,7 @@ void KLightLock::UnlockSlowPath(uintptr_t _cur_thread) { // Get the next owner. bool has_waiters; - KThread* next_owner = owner_thread->RemoveWaiterByKey( + KThread* next_owner = owner_thread->RemoveKernelWaiterByKey( std::addressof(has_waiters), reinterpret_cast(std::addressof(tag))); // Pass the lock to the next owner. -- cgit v1.2.3