diff options
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index f500fd2e7..a5aaa089d 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -146,7 +146,7 @@ static ResultCode GetProcessId(u32* process_id, Handle process_handle) { | |||
| 146 | 146 | ||
| 147 | /// Default thread wakeup callback for WaitSynchronization | 147 | /// Default thread wakeup callback for WaitSynchronization |
| 148 | static bool DefaultThreadWakeupCallback(ThreadWakeupReason reason, SharedPtr<Thread> thread, | 148 | static bool DefaultThreadWakeupCallback(ThreadWakeupReason reason, SharedPtr<Thread> thread, |
| 149 | SharedPtr<WaitObject> object, size_t index) { | 149 | SharedPtr<WaitObject> object, std::size_t index) { |
| 150 | ASSERT(thread->status == ThreadStatus::WaitSynchAny); | 150 | ASSERT(thread->status == ThreadStatus::WaitSynchAny); |
| 151 | 151 | ||
| 152 | if (reason == ThreadWakeupReason::Timeout) { | 152 | if (reason == ThreadWakeupReason::Timeout) { |
| @@ -647,16 +647,17 @@ static ResultCode SignalProcessWideKey(VAddr condition_variable_addr, s32 target | |||
| 647 | LOG_TRACE(Kernel_SVC, "called, condition_variable_addr=0x{:X}, target=0x{:08X}", | 647 | LOG_TRACE(Kernel_SVC, "called, condition_variable_addr=0x{:X}, target=0x{:08X}", |
| 648 | condition_variable_addr, target); | 648 | condition_variable_addr, target); |
| 649 | 649 | ||
| 650 | auto RetrieveWaitingThreads = | 650 | auto RetrieveWaitingThreads = [](std::size_t core_index, |
| 651 | [](size_t core_index, std::vector<SharedPtr<Thread>>& waiting_threads, VAddr condvar_addr) { | 651 | std::vector<SharedPtr<Thread>>& waiting_threads, |
| 652 | const auto& scheduler = Core::System::GetInstance().Scheduler(core_index); | 652 | VAddr condvar_addr) { |
| 653 | auto& thread_list = scheduler->GetThreadList(); | 653 | const auto& scheduler = Core::System::GetInstance().Scheduler(core_index); |
| 654 | auto& thread_list = scheduler->GetThreadList(); | ||
| 654 | 655 | ||
| 655 | for (auto& thread : thread_list) { | 656 | for (auto& thread : thread_list) { |
| 656 | if (thread->condvar_wait_address == condvar_addr) | 657 | if (thread->condvar_wait_address == condvar_addr) |
| 657 | waiting_threads.push_back(thread); | 658 | waiting_threads.push_back(thread); |
| 658 | } | 659 | } |
| 659 | }; | 660 | }; |
| 660 | 661 | ||
| 661 | // Retrieve a list of all threads that are waiting for this condition variable. | 662 | // Retrieve a list of all threads that are waiting for this condition variable. |
| 662 | std::vector<SharedPtr<Thread>> waiting_threads; | 663 | std::vector<SharedPtr<Thread>> waiting_threads; |
| @@ -672,7 +673,7 @@ static ResultCode SignalProcessWideKey(VAddr condition_variable_addr, s32 target | |||
| 672 | 673 | ||
| 673 | // Only process up to 'target' threads, unless 'target' is -1, in which case process | 674 | // Only process up to 'target' threads, unless 'target' is -1, in which case process |
| 674 | // them all. | 675 | // them all. |
| 675 | size_t last = waiting_threads.size(); | 676 | std::size_t last = waiting_threads.size(); |
| 676 | if (target != -1) | 677 | if (target != -1) |
| 677 | last = target; | 678 | last = target; |
| 678 | 679 | ||
| @@ -680,12 +681,12 @@ static ResultCode SignalProcessWideKey(VAddr condition_variable_addr, s32 target | |||
| 680 | if (last > waiting_threads.size()) | 681 | if (last > waiting_threads.size()) |
| 681 | return RESULT_SUCCESS; | 682 | return RESULT_SUCCESS; |
| 682 | 683 | ||
| 683 | for (size_t index = 0; index < last; ++index) { | 684 | for (std::size_t index = 0; index < last; ++index) { |
| 684 | auto& thread = waiting_threads[index]; | 685 | auto& thread = waiting_threads[index]; |
| 685 | 686 | ||
| 686 | ASSERT(thread->condvar_wait_address == condition_variable_addr); | 687 | ASSERT(thread->condvar_wait_address == condition_variable_addr); |
| 687 | 688 | ||
| 688 | size_t current_core = Core::System::GetInstance().CurrentCoreIndex(); | 689 | std::size_t current_core = Core::System::GetInstance().CurrentCoreIndex(); |
| 689 | 690 | ||
| 690 | auto& monitor = Core::System::GetInstance().Monitor(); | 691 | auto& monitor = Core::System::GetInstance().Monitor(); |
| 691 | 692 | ||