From 8d6342384b3932e18e98c223debd192ae1b73216 Mon Sep 17 00:00:00 2001 From: Weiyi Wang Date: Tue, 2 Apr 2019 12:30:03 -0400 Subject: HLE/IPC: HLEContext can memorize the client thread and use it for SleepClientThread This reduces the boilerplate that services have to write out the current thread explicitly. Using current thread instead of client thread is also semantically incorrect, and will be a problem when we implement multicore (at which time there will be multiple current threads) --- src/core/hle/kernel/hle_ipc.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/core/hle/kernel/hle_ipc.cpp') diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index fe710eb6e..182f6f792 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp @@ -43,7 +43,7 @@ void SessionRequestHandler::ClientDisconnected(const SharedPtr& s } SharedPtr HLERequestContext::SleepClientThread( - SharedPtr thread, const std::string& reason, u64 timeout, WakeupCallback&& callback, + const std::string& reason, u64 timeout, WakeupCallback&& callback, SharedPtr writable_event) { // Put the client thread to sleep until the wait event is signaled or the timeout expires. thread->SetWakeupCallback([context = *this, callback]( @@ -76,8 +76,9 @@ SharedPtr HLERequestContext::SleepClientThread( return writable_event; } -HLERequestContext::HLERequestContext(SharedPtr server_session) - : server_session(std::move(server_session)) { +HLERequestContext::HLERequestContext(SharedPtr server_session, + SharedPtr thread) + : server_session(std::move(server_session)), thread(thread) { cmd_buf[0] = 0; } -- cgit v1.2.3