summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-05-21 07:39:44 +0200
committerbunnei <bunneidev@gmail.com>2021-05-21 07:39:44 +0200
commit6418a42884f1a08ae6b11eb490b82c9353fa7297 (patch)
tree15064d8c6210866a9bae2d08e0d32dae639ed779 /src
parenthle: kernel: k_port: Use AcceptSession to ensure SessionList state is correct. (diff)
downloadyuzu-6418a42884f1a08ae6b11eb490b82c9353fa7297.tar
yuzu-6418a42884f1a08ae6b11eb490b82c9353fa7297.tar.gz
yuzu-6418a42884f1a08ae6b11eb490b82c9353fa7297.tar.bz2
yuzu-6418a42884f1a08ae6b11eb490b82c9353fa7297.tar.lz
yuzu-6418a42884f1a08ae6b11eb490b82c9353fa7297.tar.xz
yuzu-6418a42884f1a08ae6b11eb490b82c9353fa7297.tar.zst
yuzu-6418a42884f1a08ae6b11eb490b82c9353fa7297.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/service_thread.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/core/hle/kernel/service_thread.cpp b/src/core/hle/kernel/service_thread.cpp
index 04be8a502..2ae80beca 100644
--- a/src/core/hle/kernel/service_thread.cpp
+++ b/src/core/hle/kernel/service_thread.cpp
@@ -74,21 +74,17 @@ void ServiceThread::Impl::QueueSyncRequest(KSession& session,
{
std::unique_lock lock{queue_mutex};
+ auto* server_session{&session.GetServerSession()};
+
// Open a reference to the session to ensure it is not closes while the service request
// completes asynchronously.
- session.Open();
+ server_session->Open();
- requests.emplace([session_ptr{&session}, context{std::move(context)}]() {
+ requests.emplace([server_session, context{std::move(context)}]() {
// Close the reference.
- SCOPE_EXIT({ session_ptr->Close(); });
-
- // If the session has been closed, we are done.
- if (session_ptr->IsServerClosed()) {
- return;
- }
+ SCOPE_EXIT({ server_session->Close(); });
// Complete the service request.
- KScopedAutoObject server_session{&session_ptr->GetServerSession()};
server_session->CompleteSyncRequest(*context);
});
}