VERY experimental Nintendo Switch 2 emulator
C++
Threads do not wait for the server endpoint to call AcceptSession before returning from a ConnectToPort or GetServiceHandle call.
Subv811d684274e2
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cppindex d228e35236..c0abfd711d 100644--- a/src/core/hle/service/srv.cpp+++ b/src/core/hle/service/srv.cpp@@ -95,7 +95,8 @@ static void GetServiceHandle(Service::Interface* self) {auto client_session = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);auto server_session = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);- // TODO(Subv): Wait the current thread until the ServerPort calls AcceptSession.+ // Note: Threads do not wait for the server endpoint to call+ // AcceptSession before returning from this call.// Add the server session to the port's queueclient_port->AddWaitingSession(server_session);diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cppindex 6d990b5f2a..ab0eb9d868 100644--- a/src/core/hle/svc.cpp+++ b/src/core/hle/svc.cpp@@ -234,11 +234,12 @@ static ResultCode ConnectToPort(Handle* out_handle, const char* port_name) {auto client_session = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);auto server_session = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);- // TODO(Subv): Wait the current thread until the ServerPort calls AcceptSession.-// Add the server session to the port's queueclient_port->AddWaitingSession(server_session);+ // Note: Threads do not wait for the server endpoint to call+ // AcceptSession before returning from this call.+// Return the client sessionCASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(client_session));return RESULT_SUCCESS;