diff options
| author | 2021-06-04 19:26:48 -0700 | |
|---|---|---|
| committer | 2021-06-04 19:26:48 -0700 | |
| commit | 27ce97fd42d758350c5100c4bbcb78de0a6d48b5 (patch) | |
| tree | 7ebe2d29e0bbac3cd33dd21f8f154632aedfdea9 /src/core/hle/service/service.h | |
| parent | Merge pull request #6392 from german77/controller-widget (diff) | |
| download | yuzu-27ce97fd42d758350c5100c4bbcb78de0a6d48b5.tar.gz yuzu-27ce97fd42d758350c5100c4bbcb78de0a6d48b5.tar.xz yuzu-27ce97fd42d758350c5100c4bbcb78de0a6d48b5.zip | |
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/service/service.h')
| -rw-r--r-- | src/core/hle/service/service.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index 4c048173b..ec757753c 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h | |||
| @@ -23,6 +23,7 @@ namespace Kernel { | |||
| 23 | class HLERequestContext; | 23 | class HLERequestContext; |
| 24 | class KClientPort; | 24 | class KClientPort; |
| 25 | class KServerSession; | 25 | class KServerSession; |
| 26 | class ServiceThread; | ||
| 26 | } // namespace Kernel | 27 | } // namespace Kernel |
| 27 | 28 | ||
| 28 | namespace Service { | 29 | namespace Service { |
| @@ -41,7 +42,7 @@ class ServiceManager; | |||
| 41 | 42 | ||
| 42 | static const int kMaxPortSize = 8; ///< Maximum size of a port name (8 characters) | 43 | static const int kMaxPortSize = 8; ///< Maximum size of a port name (8 characters) |
| 43 | /// Arbitrary default number of maximum connections to an HLE service. | 44 | /// Arbitrary default number of maximum connections to an HLE service. |
| 44 | static const u32 DefaultMaxSessions = 10; | 45 | static const u32 DefaultMaxSessions = 64; |
| 45 | 46 | ||
| 46 | /** | 47 | /** |
| 47 | * This is an non-templated base of ServiceFramework to reduce code bloat and compilation times, it | 48 | * This is an non-templated base of ServiceFramework to reduce code bloat and compilation times, it |
| @@ -74,7 +75,7 @@ public: | |||
| 74 | void InvokeRequestTipc(Kernel::HLERequestContext& ctx); | 75 | void InvokeRequestTipc(Kernel::HLERequestContext& ctx); |
| 75 | 76 | ||
| 76 | /// Creates a port pair and registers it on the kernel's global port registry. | 77 | /// Creates a port pair and registers it on the kernel's global port registry. |
| 77 | Kernel::KClientPort& CreatePort(Kernel::KernelCore& kernel); | 78 | Kernel::KClientPort& CreatePort(); |
| 78 | 79 | ||
| 79 | /// Handles a synchronization request for the service. | 80 | /// Handles a synchronization request for the service. |
| 80 | ResultCode HandleSyncRequest(Kernel::KServerSession& session, | 81 | ResultCode HandleSyncRequest(Kernel::KServerSession& session, |