diff options
author | bunnei <bunneidev@gmail.com> | 2022-01-22 02:10:11 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2022-01-22 02:12:06 +0100 |
commit | 615fb40416b9ee10abf40a036b31d1540886a9b8 (patch) | |
tree | 8220ac1a9435933b995c4eab0e2e334daad3af11 /src/core/hle/kernel/k_priority_queue.h | |
parent | hle: kernel: Remove redundant tracking of dummy threads. (diff) | |
download | yuzu-615fb40416b9ee10abf40a036b31d1540886a9b8.tar yuzu-615fb40416b9ee10abf40a036b31d1540886a9b8.tar.gz yuzu-615fb40416b9ee10abf40a036b31d1540886a9b8.tar.bz2 yuzu-615fb40416b9ee10abf40a036b31d1540886a9b8.tar.lz yuzu-615fb40416b9ee10abf40a036b31d1540886a9b8.tar.xz yuzu-615fb40416b9ee10abf40a036b31d1540886a9b8.tar.zst yuzu-615fb40416b9ee10abf40a036b31d1540886a9b8.zip |
Diffstat (limited to 'src/core/hle/kernel/k_priority_queue.h')
-rw-r--r-- | src/core/hle/kernel/k_priority_queue.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/core/hle/kernel/k_priority_queue.h b/src/core/hle/kernel/k_priority_queue.h index f4d71ad7e..0b894c8cf 100644 --- a/src/core/hle/kernel/k_priority_queue.h +++ b/src/core/hle/kernel/k_priority_queue.h @@ -45,6 +45,7 @@ concept KPriorityQueueMember = !std::is_reference_v<T> && requires(T & t) { { t.GetActiveCore() } -> Common::ConvertibleTo<s32>; { t.GetPriority() } -> Common::ConvertibleTo<s32>; + { t.IsDummyThread() } -> Common::ConvertibleTo<bool>; }; template <typename Member, size_t NumCores_, int LowestPriority, int HighestPriority> @@ -349,24 +350,49 @@ public: // Mutators. constexpr void PushBack(Member* member) { + // This is for host (dummy) threads that we do not want to enter the priority queue. + if (member->IsDummyThread()) { + return; + } + this->PushBack(member->GetPriority(), member); } constexpr void Remove(Member* member) { + // This is for host (dummy) threads that we do not want to enter the priority queue. + if (member->IsDummyThread()) { + return; + } + this->Remove(member->GetPriority(), member); } constexpr void MoveToScheduledFront(Member* member) { + // This is for host (dummy) threads that we do not want to enter the priority queue. + if (member->IsDummyThread()) { + return; + } + this->scheduled_queue.MoveToFront(member->GetPriority(), member->GetActiveCore(), member); } constexpr KThread* MoveToScheduledBack(Member* member) { + // This is for host (dummy) threads that we do not want to enter the priority queue. + if (member->IsDummyThread()) { + return {}; + } + return this->scheduled_queue.MoveToBack(member->GetPriority(), member->GetActiveCore(), member); } // First class fancy operations. constexpr void ChangePriority(s32 prev_priority, bool is_running, Member* member) { + // This is for host (dummy) threads that we do not want to enter the priority queue. + if (member->IsDummyThread()) { + return; + } + ASSERT(IsValidPriority(prev_priority)); // Remove the member from the queues. @@ -383,6 +409,11 @@ public: constexpr void ChangeAffinityMask(s32 prev_core, const AffinityMaskType& prev_affinity, Member* member) { + // This is for host (dummy) threads that we do not want to enter the priority queue. + if (member->IsDummyThread()) { + return; + } + // Get the new information. const s32 priority = member->GetPriority(); const AffinityMaskType& new_affinity = member->GetAffinityMask(); @@ -412,6 +443,11 @@ public: } constexpr void ChangeCore(s32 prev_core, Member* member, bool to_front = false) { + // This is for host (dummy) threads that we do not want to enter the priority queue. + if (member->IsDummyThread()) { + return; + } + // Get the new information. const s32 new_core = member->GetActiveCore(); const s32 priority = member->GetPriority(); |