From fdf90c6d75c68c4ff1bebbc0ece30d2a507d007d Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 6 Mar 2023 20:53:58 -0500 Subject: kernel: convert KConditionVariable, KLightConditionVariable, KLightLock --- src/core/hle/kernel/k_condition_variable.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/core/hle/kernel/k_condition_variable.h') diff --git a/src/core/hle/kernel/k_condition_variable.h b/src/core/hle/kernel/k_condition_variable.h index fad4ed011..41635a894 100644 --- a/src/core/hle/kernel/k_condition_variable.h +++ b/src/core/hle/kernel/k_condition_variable.h @@ -21,24 +21,24 @@ class KConditionVariable { public: using ThreadTree = typename KThread::ConditionVariableThreadTreeType; - explicit KConditionVariable(Core::System& system_); + explicit KConditionVariable(Core::System& system); ~KConditionVariable(); // Arbitration - [[nodiscard]] Result SignalToAddress(VAddr addr); - [[nodiscard]] Result WaitForAddress(Handle handle, VAddr addr, u32 value); + Result SignalToAddress(VAddr addr); + Result WaitForAddress(Handle handle, VAddr addr, u32 value); // Condition variable void Signal(u64 cv_key, s32 count); - [[nodiscard]] Result Wait(VAddr addr, u64 key, u32 value, s64 timeout); + Result Wait(VAddr addr, u64 key, u32 value, s64 timeout); private: void SignalImpl(KThread* thread); - ThreadTree thread_tree; - - Core::System& system; - KernelCore& kernel; +private: + Core::System& m_system; + KernelCore& m_kernel; + ThreadTree m_tree{}; }; inline void BeforeUpdatePriority(const KernelCore& kernel, KConditionVariable::ThreadTree* tree, -- cgit v1.2.3 From 6bfb4c8f713323bb39b7e38a779c35583fc61bcc Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 7 Mar 2023 16:11:50 -0500 Subject: kernel: convert KThread to new style --- src/core/hle/kernel/k_condition_variable.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/hle/kernel/k_condition_variable.h') diff --git a/src/core/hle/kernel/k_condition_variable.h b/src/core/hle/kernel/k_condition_variable.h index 41635a894..fbd2c1fc0 100644 --- a/src/core/hle/kernel/k_condition_variable.h +++ b/src/core/hle/kernel/k_condition_variable.h @@ -41,16 +41,16 @@ private: ThreadTree m_tree{}; }; -inline void BeforeUpdatePriority(const KernelCore& kernel, KConditionVariable::ThreadTree* tree, +inline void BeforeUpdatePriority(KernelCore& kernel, KConditionVariable::ThreadTree* tree, KThread* thread) { - ASSERT(kernel.GlobalSchedulerContext().IsLocked()); + ASSERT(KScheduler::IsSchedulerLockedByCurrentThread(kernel)); tree->erase(tree->iterator_to(*thread)); } -inline void AfterUpdatePriority(const KernelCore& kernel, KConditionVariable::ThreadTree* tree, +inline void AfterUpdatePriority(KernelCore& kernel, KConditionVariable::ThreadTree* tree, KThread* thread) { - ASSERT(kernel.GlobalSchedulerContext().IsLocked()); + ASSERT(KScheduler::IsSchedulerLockedByCurrentThread(kernel)); tree->insert(*thread); } -- cgit v1.2.3