summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/client_session.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-12-01 00:56:35 +0100
committerGitHub <noreply@github.com>2019-12-01 00:56:35 +0100
commit5c7253f8d3c010c0a0e5c91db497819829cb4a43 (patch)
treec2aa6989d3f081c07c72c3ab4a698c73ecd8c429 /src/core/hle/kernel/client_session.cpp
parentMerge pull request #3184 from ReinUsesLisp/framebuffer-cache (diff)
parentkernel: Implement a more accurate IPC dispatch. (diff)
downloadyuzu-5c7253f8d3c010c0a0e5c91db497819829cb4a43.tar
yuzu-5c7253f8d3c010c0a0e5c91db497819829cb4a43.tar.gz
yuzu-5c7253f8d3c010c0a0e5c91db497819829cb4a43.tar.bz2
yuzu-5c7253f8d3c010c0a0e5c91db497819829cb4a43.tar.lz
yuzu-5c7253f8d3c010c0a0e5c91db497819829cb4a43.tar.xz
yuzu-5c7253f8d3c010c0a0e5c91db497819829cb4a43.tar.zst
yuzu-5c7253f8d3c010c0a0e5c91db497819829cb4a43.zip
Diffstat (limited to 'src/core/hle/kernel/client_session.cpp')
-rw-r--r--src/core/hle/kernel/client_session.cpp40
1 files changed, 31 insertions, 9 deletions
diff --git a/src/core/hle/kernel/client_session.cpp b/src/core/hle/kernel/client_session.cpp
index 9849dbe91..4669a14ad 100644
--- a/src/core/hle/kernel/client_session.cpp
+++ b/src/core/hle/kernel/client_session.cpp
@@ -1,4 +1,4 @@
-// Copyright 2016 Citra Emulator Project
+// Copyright 2019 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
@@ -12,22 +12,44 @@
namespace Kernel {
-ClientSession::ClientSession(KernelCore& kernel) : Object{kernel} {}
+ClientSession::ClientSession(KernelCore& kernel) : WaitObject{kernel} {}
+
ClientSession::~ClientSession() {
// This destructor will be called automatically when the last ClientSession handle is closed by
// the emulated application.
- if (auto server = parent->server.lock()) {
- server->ClientDisconnected();
+ if (parent->Server()) {
+ parent->Server()->ClientDisconnected();
}
}
-ResultCode ClientSession::SendSyncRequest(Thread* thread, Memory::Memory& memory) {
- // Signal the server session that new data is available
- if (auto server = parent->server.lock()) {
- return server->HandleSyncRequest(SharedFrom(thread), memory);
+bool ClientSession::ShouldWait(const Thread* thread) const {
+ UNIMPLEMENTED();
+ return {};
+}
+
+void ClientSession::Acquire(Thread* thread) {
+ UNIMPLEMENTED();
+}
+
+ResultVal<std::shared_ptr<ClientSession>> ClientSession::Create(KernelCore& kernel,
+ std::shared_ptr<Session> parent,
+ std::string name) {
+ std::shared_ptr<ClientSession> client_session{std::make_shared<ClientSession>(kernel)};
+
+ client_session->name = std::move(name);
+ client_session->parent = std::move(parent);
+
+ return MakeResult(std::move(client_session));
+}
+
+ResultCode ClientSession::SendSyncRequest(std::shared_ptr<Thread> thread, Memory::Memory& memory) {
+ // Keep ServerSession alive until we're done working with it.
+ if (!parent->Server()) {
+ return ERR_SESSION_CLOSED_BY_REMOTE;
}
- return ERR_SESSION_CLOSED_BY_REMOTE;
+ // Signal the server session that new data is available
+ return parent->Server()->HandleSyncRequest(std::move(thread), memory);
}
} // namespace Kernel