diff options
author | Subv <subv2112@gmail.com> | 2017-06-29 19:30:34 +0200 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2017-06-29 19:30:34 +0200 |
commit | b53fa9514fd8d6aa9a93629ab5512da7706c536d (patch) | |
tree | 532b6c6ee98292647bb1d6dbfc1a362c6358ffcb /src/core/hle | |
parent | Kernel/Sessions: Clean up the list of pending request threads of a session when the client endpoint is closed. (diff) | |
download | yuzu-b53fa9514fd8d6aa9a93629ab5512da7706c536d.tar yuzu-b53fa9514fd8d6aa9a93629ab5512da7706c536d.tar.gz yuzu-b53fa9514fd8d6aa9a93629ab5512da7706c536d.tar.bz2 yuzu-b53fa9514fd8d6aa9a93629ab5512da7706c536d.tar.lz yuzu-b53fa9514fd8d6aa9a93629ab5512da7706c536d.tar.xz yuzu-b53fa9514fd8d6aa9a93629ab5512da7706c536d.tar.zst yuzu-b53fa9514fd8d6aa9a93629ab5512da7706c536d.zip |
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/kernel/client_session.cpp | 5 | ||||
-rw-r--r-- | src/core/hle/kernel/client_session.h | 4 | ||||
-rw-r--r-- | src/core/hle/svc.cpp | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/core/hle/kernel/client_session.cpp b/src/core/hle/kernel/client_session.cpp index e9cf05747..646a5cc64 100644 --- a/src/core/hle/kernel/client_session.cpp +++ b/src/core/hle/kernel/client_session.cpp @@ -9,6 +9,7 @@ #include "core/hle/kernel/hle_ipc.h" #include "core/hle/kernel/server_session.h" #include "core/hle/kernel/session.h" +#include "core/hle/kernel/thread.h" namespace Kernel { @@ -37,14 +38,14 @@ ClientSession::~ClientSession() { parent->client = nullptr; } -ResultCode ClientSession::SendSyncRequest() { +ResultCode ClientSession::SendSyncRequest(SharedPtr<Thread> thread) { // Keep ServerSession alive until we're done working with it. SharedPtr<ServerSession> server = parent->server; if (server == nullptr) return ERR_SESSION_CLOSED_BY_REMOTE; // Signal the server session that new data is available - return server->HandleSyncRequest(GetCurrentThread()); + return server->HandleSyncRequest(std::move(thread)); } } // namespace diff --git a/src/core/hle/kernel/client_session.h b/src/core/hle/kernel/client_session.h index 2de379c09..daf521529 100644 --- a/src/core/hle/kernel/client_session.h +++ b/src/core/hle/kernel/client_session.h @@ -14,6 +14,7 @@ namespace Kernel { class ServerSession; class Session; +class Thread; class ClientSession final : public Object { public: @@ -34,9 +35,10 @@ public: /** * Sends an SyncRequest from the current emulated thread. + * @param thread Thread that initiated the request. * @return ResultCode of the operation. */ - ResultCode SendSyncRequest(); + ResultCode SendSyncRequest(SharedPtr<Thread> thread); std::string name; ///< Name of client port (optional) diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 2cdbe3fb9..0a7f011f3 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -237,7 +237,7 @@ static ResultCode SendSyncRequest(Kernel::Handle handle) { // TODO(Subv): svcSendSyncRequest should put the caller thread to sleep while the server // responds and cause a reschedule. - return session->SendSyncRequest(); + return session->SendSyncRequest(Kernel::GetCurrentThread()); } /// Close a handle |