summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/address_arbiter.cpp17
-rw-r--r--src/core/hle/kernel/address_arbiter.h2
2 files changed, 9 insertions, 10 deletions
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp
index 2ea3dcb61..a1287de93 100644
--- a/src/core/hle/kernel/address_arbiter.cpp
+++ b/src/core/hle/kernel/address_arbiter.cpp
@@ -228,15 +228,14 @@ void AddressArbiter::RemoveThread(std::shared_ptr<Thread> thread) {
228 UNREACHABLE(); 228 UNREACHABLE();
229} 229}
230 230
231std::vector<std::shared_ptr<Thread>> AddressArbiter::GetThreadsWaitingOnAddress(VAddr address) { 231std::vector<std::shared_ptr<Thread>> AddressArbiter::GetThreadsWaitingOnAddress(
232 std::vector<std::shared_ptr<Thread>> result; 232 VAddr address) const {
233 std::list<std::shared_ptr<Thread>>& thread_list = arb_threads[address]; 233 const auto iter = arb_threads.find(address);
234 auto it = thread_list.begin(); 234 if (iter == arb_threads.cend()) {
235 while (it != thread_list.end()) { 235 return {};
236 std::shared_ptr<Thread> current_thread = *it;
237 result.push_back(std::move(current_thread));
238 ++it;
239 } 236 }
240 return result; 237
238 const std::list<std::shared_ptr<Thread>>& thread_list = iter->second;
239 return {thread_list.cbegin(), thread_list.cend()};
241} 240}
242} // namespace Kernel 241} // namespace Kernel
diff --git a/src/core/hle/kernel/address_arbiter.h b/src/core/hle/kernel/address_arbiter.h
index 386983e54..f958eee5a 100644
--- a/src/core/hle/kernel/address_arbiter.h
+++ b/src/core/hle/kernel/address_arbiter.h
@@ -86,7 +86,7 @@ private:
86 void RemoveThread(std::shared_ptr<Thread> thread); 86 void RemoveThread(std::shared_ptr<Thread> thread);
87 87
88 // Gets the threads waiting on an address. 88 // Gets the threads waiting on an address.
89 std::vector<std::shared_ptr<Thread>> GetThreadsWaitingOnAddress(VAddr address); 89 std::vector<std::shared_ptr<Thread>> GetThreadsWaitingOnAddress(VAddr address) const;
90 90
91 /// List of threads waiting for a address arbiter 91 /// List of threads waiting for a address arbiter
92 std::unordered_map<VAddr, std::list<std::shared_ptr<Thread>>> arb_threads; 92 std::unordered_map<VAddr, std::list<std::shared_ptr<Thread>>> arb_threads;