diff options
author | Liam <byteslice@airmail.cc> | 2023-02-24 02:32:03 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-03-01 16:42:45 +0100 |
commit | 97f7f7bad59cdd42bf5f504089e5cecd441da3ce (patch) | |
tree | 1d7489c0bda11fb4e99e0a6d1acea4d4406861d4 /src/core/hle/kernel/k_thread.h | |
parent | kernel: refactor priority inheritance to represent locks as C++ objects (diff) | |
download | yuzu-97f7f7bad59cdd42bf5f504089e5cecd441da3ce.tar yuzu-97f7f7bad59cdd42bf5f504089e5cecd441da3ce.tar.gz yuzu-97f7f7bad59cdd42bf5f504089e5cecd441da3ce.tar.bz2 yuzu-97f7f7bad59cdd42bf5f504089e5cecd441da3ce.tar.lz yuzu-97f7f7bad59cdd42bf5f504089e5cecd441da3ce.tar.xz yuzu-97f7f7bad59cdd42bf5f504089e5cecd441da3ce.tar.zst yuzu-97f7f7bad59cdd42bf5f504089e5cecd441da3ce.zip |
Diffstat (limited to 'src/core/hle/kernel/k_thread.h')
-rw-r--r-- | src/core/hle/kernel/k_thread.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h index e09dcbea0..bd125f5f1 100644 --- a/src/core/hle/kernel/k_thread.h +++ b/src/core/hle/kernel/k_thread.h @@ -595,7 +595,13 @@ public: [[nodiscard]] Result GetThreadContext3(std::vector<u8>& out); - [[nodiscard]] KThread* RemoveWaiterByKey(bool* out_has_waiters, VAddr key); + [[nodiscard]] KThread* RemoveUserWaiterByKey(bool* out_has_waiters, VAddr key) { + return this->RemoveWaiterByKey(out_has_waiters, key, false); + } + + [[nodiscard]] KThread* RemoveKernelWaiterByKey(bool* out_has_waiters, VAddr key) { + return this->RemoveWaiterByKey(out_has_waiters, key, true); + } [[nodiscard]] VAddr GetAddressKey() const { return address_key; @@ -666,6 +672,9 @@ public: } private: + [[nodiscard]] KThread* RemoveWaiterByKey(bool* out_has_waiters, VAddr key, + bool is_kernel_address_key); + static constexpr size_t PriorityInheritanceCountMax = 10; union SyncObjectBuffer { std::array<KSynchronizationObject*, Svc::ArgumentHandleCountMax> sync_objects{}; @@ -850,7 +859,7 @@ public: } void AddHeldLock(LockWithPriorityInheritanceInfo* lock_info); - LockWithPriorityInheritanceInfo* FindHeldLock(VAddr address_key); + LockWithPriorityInheritanceInfo* FindHeldLock(VAddr address_key, bool is_kernel_address_key); private: using LockWithPriorityInheritanceInfoList = @@ -926,6 +935,7 @@ public: condvar_key = cv_key; address_key = address; address_key_value = value; + is_kernel_address_key = false; } void ClearConditionVariable() { |