diff options
author | bunnei <bunneidev@gmail.com> | 2020-02-14 20:40:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-14 20:40:20 +0100 |
commit | f552d553bac1374c583d748dad27f8c86e86c4a0 (patch) | |
tree | 1da4aa037ff417fa4fd43bffac267dcb2b55a72d /src/core/hle/kernel/server_session.cpp | |
parent | Merge pull request #3379 from ReinUsesLisp/cbuf-offset (diff) | |
parent | Core: Correct compilition in GCC (diff) | |
download | yuzu-f552d553bac1374c583d748dad27f8c86e86c4a0.tar yuzu-f552d553bac1374c583d748dad27f8c86e86c4a0.tar.gz yuzu-f552d553bac1374c583d748dad27f8c86e86c4a0.tar.bz2 yuzu-f552d553bac1374c583d748dad27f8c86e86c4a0.tar.lz yuzu-f552d553bac1374c583d748dad27f8c86e86c4a0.tar.xz yuzu-f552d553bac1374c583d748dad27f8c86e86c4a0.tar.zst yuzu-f552d553bac1374c583d748dad27f8c86e86c4a0.zip |
Diffstat (limited to 'src/core/hle/kernel/server_session.cpp')
-rw-r--r-- | src/core/hle/kernel/server_session.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp index 7825e1ec4..4604e35c5 100644 --- a/src/core/hle/kernel/server_session.cpp +++ b/src/core/hle/kernel/server_session.cpp @@ -24,7 +24,7 @@ namespace Kernel { -ServerSession::ServerSession(KernelCore& kernel) : WaitObject{kernel} {} +ServerSession::ServerSession(KernelCore& kernel) : SynchronizationObject{kernel} {} ServerSession::~ServerSession() = default; ResultVal<std::shared_ptr<ServerSession>> ServerSession::Create(KernelCore& kernel, @@ -50,6 +50,16 @@ bool ServerSession::ShouldWait(const Thread* thread) const { return pending_requesting_threads.empty() || currently_handling != nullptr; } +bool ServerSession::IsSignaled() const { + // Closed sessions should never wait, an error will be returned from svcReplyAndReceive. + if (!parent->Client()) { + return true; + } + + // Wait if we have no pending requests, or if we're currently handling a request. + return !pending_requesting_threads.empty() && currently_handling == nullptr; +} + void ServerSession::Acquire(Thread* thread) { ASSERT_MSG(!ShouldWait(thread), "object unavailable!"); // We are now handling a request, pop it from the stack. |