summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_condition_variable.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-04-10 07:10:14 +0200
committerbunnei <bunneidev@gmail.com>2021-05-06 01:40:51 +0200
commitb6156e735cd78d4b7863491ae6bdc63e44404b73 (patch)
treee1ec7753ea7c86223135e2f51b1b1f649af48b90 /src/core/hle/kernel/k_condition_variable.cpp
parenthle: kernel: Ensure all kernel objects with KAutoObject are properly created. (diff)
downloadyuzu-b6156e735cd78d4b7863491ae6bdc63e44404b73.tar
yuzu-b6156e735cd78d4b7863491ae6bdc63e44404b73.tar.gz
yuzu-b6156e735cd78d4b7863491ae6bdc63e44404b73.tar.bz2
yuzu-b6156e735cd78d4b7863491ae6bdc63e44404b73.tar.lz
yuzu-b6156e735cd78d4b7863491ae6bdc63e44404b73.tar.xz
yuzu-b6156e735cd78d4b7863491ae6bdc63e44404b73.tar.zst
yuzu-b6156e735cd78d4b7863491ae6bdc63e44404b73.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/k_condition_variable.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/hle/kernel/k_condition_variable.cpp b/src/core/hle/kernel/k_condition_variable.cpp
index 930f78974..72565af05 100644
--- a/src/core/hle/kernel/k_condition_variable.cpp
+++ b/src/core/hle/kernel/k_condition_variable.cpp
@@ -185,11 +185,11 @@ KThread* KConditionVariable::SignalImpl(KThread* thread) {
thread->Wakeup();
} else {
// Get the previous owner.
- KThread* owner_thread =
- kernel.CurrentProcess()->GetHandleTable()
- .GetObjectWithoutPseudoHandle<KThread>(
- static_cast<Handle>(prev_tag & ~Svc::HandleWaitMask))
- .ReleasePointerUnsafe();
+ KThread* owner_thread = kernel.CurrentProcess()
+ ->GetHandleTable()
+ .GetObjectWithoutPseudoHandle<KThread>(
+ static_cast<Handle>(prev_tag & ~Svc::HandleWaitMask))
+ .ReleasePointerUnsafe();
if (owner_thread) {
// Add the thread as a waiter on the owner.
@@ -214,7 +214,7 @@ void KConditionVariable::Signal(u64 cv_key, s32 count) {
// Prepare for signaling.
constexpr int MaxThreads = 16;
- KLinkedList<KThread> thread_list;
+ KLinkedList<KThread> thread_list{kernel};
std::array<KThread*, MaxThreads> thread_array;
s32 num_to_close{};
@@ -254,7 +254,8 @@ void KConditionVariable::Signal(u64 cv_key, s32 count) {
}
// Close threads in the list.
- for (auto it = thread_list.begin(); it != thread_list.end(); it = thread_list.erase(it)) {
+ for (auto it = thread_list.begin(); it != thread_list.end();
+ it = thread_list.erase(kernel, it)) {
(*it).Close();
}
}