From ad53dc22fde4b4227fa78088cbe30b5f5b6617ba Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 17 Jan 2022 16:51:18 -0800 Subject: hle: kernel: KServerSession: Simplify CompleteSyncRequest EndWait. - Considering is_thread_waiting is never set, so we can remove IsThreadWaiting. - KThread::EndWait will take the scheduler lock, so we can remove the redundant lock. --- src/core/hle/kernel/hle_ipc.h | 5 ----- src/core/hle/kernel/k_server_session.cpp | 9 ++------- 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'src/core') diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index 55e6fb9f7..754b41ff6 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h @@ -341,10 +341,6 @@ public: return *thread; } - bool IsThreadWaiting() const { - return is_thread_waiting; - } - private: friend class IPC::ResponseBuilder; @@ -379,7 +375,6 @@ private: u32 domain_offset{}; std::shared_ptr manager; - bool is_thread_waiting{}; KernelCore& kernel; Core::Memory::Memory& memory; diff --git a/src/core/hle/kernel/k_server_session.cpp b/src/core/hle/kernel/k_server_session.cpp index d4e4a6b06..2ea995d9a 100644 --- a/src/core/hle/kernel/k_server_session.cpp +++ b/src/core/hle/kernel/k_server_session.cpp @@ -171,13 +171,8 @@ ResultCode KServerSession::CompleteSyncRequest(HLERequestContext& context) { convert_to_domain = false; } - // Some service requests require the thread to block - { - KScopedSchedulerLock lock(kernel); - if (!context.IsThreadWaiting()) { - context.GetThread().EndWait(result); - } - } + // The calling thread is waiting for this request to complete, so wake it up. + context.GetThread().EndWait(result); return result; } -- cgit v1.2.3