diff options
author | bunnei <bunneidev@gmail.com> | 2021-06-07 07:52:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-07 07:52:07 +0200 |
commit | 28eb8c83d479403b5da88ae7d3d2a1c6b81a6552 (patch) | |
tree | 43b28bb3b8df05e3f19fe4a151571dedd7171255 /src/core/hle/kernel/hle_ipc.h | |
parent | Merge pull request #6400 from ameerj/disable-uniform-simplify (diff) | |
parent | hle: kernel: KServerSession: Use ASSERT_MSG where appropriate. (diff) | |
download | yuzu-28eb8c83d479403b5da88ae7d3d2a1c6b81a6552.tar yuzu-28eb8c83d479403b5da88ae7d3d2a1c6b81a6552.tar.gz yuzu-28eb8c83d479403b5da88ae7d3d2a1c6b81a6552.tar.bz2 yuzu-28eb8c83d479403b5da88ae7d3d2a1c6b81a6552.tar.lz yuzu-28eb8c83d479403b5da88ae7d3d2a1c6b81a6552.tar.xz yuzu-28eb8c83d479403b5da88ae7d3d2a1c6b81a6552.tar.zst yuzu-28eb8c83d479403b5da88ae7d3d2a1c6b81a6552.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/hle_ipc.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index b47e363cc..2aaf93fca 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h @@ -46,6 +46,7 @@ class KThread; class KReadableEvent; class KSession; class KWritableEvent; +class ServiceThread; enum class ThreadWakeupReason; @@ -56,7 +57,7 @@ enum class ThreadWakeupReason; */ class SessionRequestHandler : public std::enable_shared_from_this<SessionRequestHandler> { public: - SessionRequestHandler(); + SessionRequestHandler(KernelCore& kernel, const char* service_name_); virtual ~SessionRequestHandler(); /** @@ -83,6 +84,14 @@ public: * @param server_session ServerSession associated with the connection. */ void ClientDisconnected(KServerSession* session); + + std::shared_ptr<ServiceThread> GetServiceThread() const { + return service_thread.lock(); + } + +protected: + KernelCore& kernel; + std::weak_ptr<ServiceThread> service_thread; }; using SessionRequestHandlerPtr = std::shared_ptr<SessionRequestHandler>; @@ -94,7 +103,8 @@ using SessionRequestHandlerPtr = std::shared_ptr<SessionRequestHandler>; */ class SessionRequestManager final { public: - SessionRequestManager() = default; + explicit SessionRequestManager(KernelCore& kernel); + ~SessionRequestManager(); bool IsDomain() const { return is_domain; @@ -142,10 +152,18 @@ public: session_handler = std::move(handler); } + std::shared_ptr<ServiceThread> GetServiceThread() const { + return session_handler->GetServiceThread(); + } + private: bool is_domain{}; SessionRequestHandlerPtr session_handler; std::vector<SessionRequestHandlerPtr> domain_handlers; + +private: + KernelCore& kernel; + std::weak_ptr<ServiceThread> service_thread; }; /** |