diff options
| author | bunnei <bunneidev@gmail.com> | 2021-06-04 19:26:48 -0700 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2021-06-04 19:26:48 -0700 |
| commit | 27ce97fd42d758350c5100c4bbcb78de0a6d48b5 (patch) | |
| tree | 7ebe2d29e0bbac3cd33dd21f8f154632aedfdea9 /src/core/hle/kernel/k_server_session.h | |
| parent | c8b3d928368b12dba3bf0f4221f7013e464540dd (diff) | |
hle: kernel: Refactor to allocate a ServiceThread per service handler.
- Previously, we would allocate a thread per session, which adds new threads on CloneCurrentObject.
- This results in race conditions with N sessions queuing requests to the same service interface.
- Fixes Pokken Tournament DX crashes/softlocks, which were regressed by #6347.
Diffstat (limited to 'src/core/hle/kernel/k_server_session.h')
| -rw-r--r-- | src/core/hle/kernel/k_server_session.h | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/core/hle/kernel/k_server_session.h b/src/core/hle/kernel/k_server_session.h index 27b757ad2..0f4b51e37 100644 --- a/src/core/hle/kernel/k_server_session.h +++ b/src/core/hle/kernel/k_server_session.h @@ -32,6 +32,7 @@ class HLERequestContext; class KernelCore; class KSession; class SessionRequestHandler; +class SessionRequestManager; class KThread; class KServerSession final : public KSynchronizationObject, @@ -46,7 +47,8 @@ public: void Destroy() override; - void Initialize(KSession* parent_, std::string&& name_); + void Initialize(KSession* parent_, std::string&& name_, + std::shared_ptr<SessionRequestManager> manager_); KSession* GetParent() { return parent; @@ -104,16 +106,6 @@ public: return manager; } - /// Gets the session request manager, which forwards requests to the underlying service - const std::shared_ptr<SessionRequestManager>& GetSessionRequestManager() const { - return manager; - } - - /// Sets the session request manager, which forwards requests to the underlying service - void SetSessionRequestManager(std::shared_ptr<SessionRequestManager> manager_) { - manager = std::move(manager_); - } - private: /// Queues a sync request from the emulated application. ResultCode QueueSyncRequest(KThread* thread, Core::Memory::Memory& memory); @@ -131,9 +123,6 @@ private: /// When set to True, converts the session to a domain at the end of the command bool convert_to_domain{}; - /// Thread to dispatch service requests - std::weak_ptr<ServiceThread> service_thread; - /// KSession that owns this KServerSession KSession* parent{}; }; |
