summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-02-12 21:07:15 +0100
committerLioncash <mathew1800@gmail.com>2020-02-12 21:10:16 +0100
commit9f2c703137661473c7362f9c9d6a9df8bedce862 (patch)
treef9074082bddb616bc6f7a0c13fa0e25fd84d90ba /src/core
parentMerge pull request #3403 from lioncash/debug (diff)
downloadyuzu-9f2c703137661473c7362f9c9d6a9df8bedce862.tar
yuzu-9f2c703137661473c7362f9c9d6a9df8bedce862.tar.gz
yuzu-9f2c703137661473c7362f9c9d6a9df8bedce862.tar.bz2
yuzu-9f2c703137661473c7362f9c9d6a9df8bedce862.tar.lz
yuzu-9f2c703137661473c7362f9c9d6a9df8bedce862.tar.xz
yuzu-9f2c703137661473c7362f9c9d6a9df8bedce862.tar.zst
yuzu-9f2c703137661473c7362f9c9d6a9df8bedce862.zip
Diffstat (limited to '')
-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) {
UNREACHABLE();
}
-std::vector<std::shared_ptr<Thread>> AddressArbiter::GetThreadsWaitingOnAddress(VAddr address) {
- std::vector<std::shared_ptr<Thread>> result;
- std::list<std::shared_ptr<Thread>>& thread_list = arb_threads[address];
- auto it = thread_list.begin();
- while (it != thread_list.end()) {
- std::shared_ptr<Thread> current_thread = *it;
- result.push_back(std::move(current_thread));
- ++it;
+std::vector<std::shared_ptr<Thread>> AddressArbiter::GetThreadsWaitingOnAddress(
+ VAddr address) const {
+ const auto iter = arb_threads.find(address);
+ if (iter == arb_threads.cend()) {
+ return {};
}
- return result;
+
+ const std::list<std::shared_ptr<Thread>>& thread_list = iter->second;
+ return {thread_list.cbegin(), thread_list.cend()};
}
} // 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:
void RemoveThread(std::shared_ptr<Thread> thread);
// Gets the threads waiting on an address.
- std::vector<std::shared_ptr<Thread>> GetThreadsWaitingOnAddress(VAddr address);
+ std::vector<std::shared_ptr<Thread>> GetThreadsWaitingOnAddress(VAddr address) const;
/// List of threads waiting for a address arbiter
std::unordered_map<VAddr, std::list<std::shared_ptr<Thread>>> arb_threads;