diff options
author | bunnei <bunneidev@gmail.com> | 2018-09-17 15:51:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-17 15:51:47 +0200 |
commit | 076add4ccddff3940e20fc320615e3d330f77119 (patch) | |
tree | bacabcfed8665974c276489509a1caa330ad36a2 /src/core/hle/kernel/address_arbiter.cpp | |
parent | Merge pull request #1329 from raven02/bgr5a1u (diff) | |
parent | Port #4182 from Citra: "Prefix all size_t with std::" (diff) | |
download | yuzu-076add4ccddff3940e20fc320615e3d330f77119.tar yuzu-076add4ccddff3940e20fc320615e3d330f77119.tar.gz yuzu-076add4ccddff3940e20fc320615e3d330f77119.tar.bz2 yuzu-076add4ccddff3940e20fc320615e3d330f77119.tar.lz yuzu-076add4ccddff3940e20fc320615e3d330f77119.tar.xz yuzu-076add4ccddff3940e20fc320615e3d330f77119.tar.zst yuzu-076add4ccddff3940e20fc320615e3d330f77119.zip |
Diffstat (limited to 'src/core/hle/kernel/address_arbiter.cpp')
-rw-r--r-- | src/core/hle/kernel/address_arbiter.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index 6657accd5..93577591f 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp @@ -35,16 +35,17 @@ static ResultCode WaitForAddress(VAddr address, s64 timeout) { // Gets the threads waiting on an address. static std::vector<SharedPtr<Thread>> GetThreadsWaitingOnAddress(VAddr address) { - const auto RetrieveWaitingThreads = - [](size_t core_index, std::vector<SharedPtr<Thread>>& waiting_threads, VAddr arb_addr) { - const auto& scheduler = Core::System::GetInstance().Scheduler(core_index); - auto& thread_list = scheduler->GetThreadList(); - - for (auto& thread : thread_list) { - if (thread->arb_wait_address == arb_addr) - waiting_threads.push_back(thread); - } - }; + const auto RetrieveWaitingThreads = [](std::size_t core_index, + std::vector<SharedPtr<Thread>>& waiting_threads, + VAddr arb_addr) { + const auto& scheduler = Core::System::GetInstance().Scheduler(core_index); + auto& thread_list = scheduler->GetThreadList(); + + for (auto& thread : thread_list) { + if (thread->arb_wait_address == arb_addr) + waiting_threads.push_back(thread); + } + }; // Retrieve all threads that are waiting for this address. std::vector<SharedPtr<Thread>> threads; @@ -66,12 +67,12 @@ static std::vector<SharedPtr<Thread>> GetThreadsWaitingOnAddress(VAddr address) static void WakeThreads(std::vector<SharedPtr<Thread>>& waiting_threads, s32 num_to_wake) { // Only process up to 'target' threads, unless 'target' is <= 0, in which case process // them all. - size_t last = waiting_threads.size(); + std::size_t last = waiting_threads.size(); if (num_to_wake > 0) last = num_to_wake; // Signal the waiting threads. - for (size_t i = 0; i < last; i++) { + for (std::size_t i = 0; i < last; i++) { ASSERT(waiting_threads[i]->status == ThreadStatus::WaitArb); waiting_threads[i]->SetWaitSynchronizationResult(RESULT_SUCCESS); waiting_threads[i]->arb_wait_address = 0; |