diff options
author | Lioncash <mathew1800@gmail.com> | 2019-03-06 00:51:16 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-03-06 02:10:07 +0100 |
commit | 221613d4ead717dc788d0f391c22c31db5fe2530 (patch) | |
tree | 5a6c05e74ebfc0ff8b371904a9d1741b172d63b7 /src/core/hle/kernel/server_session.cpp | |
parent | kernel/client_session: Make data members private (diff) | |
download | yuzu-221613d4ead717dc788d0f391c22c31db5fe2530.tar yuzu-221613d4ead717dc788d0f391c22c31db5fe2530.tar.gz yuzu-221613d4ead717dc788d0f391c22c31db5fe2530.tar.bz2 yuzu-221613d4ead717dc788d0f391c22c31db5fe2530.tar.lz yuzu-221613d4ead717dc788d0f391c22c31db5fe2530.tar.xz yuzu-221613d4ead717dc788d0f391c22c31db5fe2530.tar.zst yuzu-221613d4ead717dc788d0f391c22c31db5fe2530.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/server_session.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp index 027434f92..3452a9c0c 100644 --- a/src/core/hle/kernel/server_session.cpp +++ b/src/core/hle/kernel/server_session.cpp @@ -63,6 +63,34 @@ void ServerSession::Acquire(Thread* thread) { pending_requesting_threads.pop_back(); } +void ServerSession::ClientDisconnected() { + // We keep a shared pointer to the hle handler to keep it alive throughout + // the call to ClientDisconnected, as ClientDisconnected invalidates the + // hle_handler member itself during the course of the function executing. + std::shared_ptr<SessionRequestHandler> handler = hle_handler; + if (handler) { + // Note that after this returns, this server session's hle_handler is + // invalidated (set to null). + handler->ClientDisconnected(this); + } + + // TODO(Subv): Force a wake up of all the ServerSession's waiting threads and set + // their WaitSynchronization result to 0xC920181A. + + // Clean up the list of client threads with pending requests, they are unneeded now that the + // client endpoint is closed. + pending_requesting_threads.clear(); + currently_handling = nullptr; +} + +void ServerSession::AppendDomainRequestHandler(std::shared_ptr<SessionRequestHandler> handler) { + domain_request_handlers.push_back(std::move(handler)); +} + +std::size_t ServerSession::NumDomainRequestHandlers() const { + return domain_request_handlers.size(); +} + ResultCode ServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& context) { auto* const domain_message_header = context.GetDomainMessageHeader(); if (domain_message_header) { |