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.
This commit is contained in:
bunnei
2021-06-04 19:26:48 -07:00
parent c8b3d92836
commit 27ce97fd42
13 changed files with 75 additions and 67 deletions

View File

@ -13,6 +13,8 @@
namespace Kernel {
class SessionRequestManager;
class KSession final : public KAutoObjectWithSlabHeapAndContainer<KSession, KAutoObjectWithList> {
KERNEL_AUTOOBJECT_TRAITS(KSession, KAutoObject);
@ -20,7 +22,8 @@ public:
explicit KSession(KernelCore& kernel_);
~KSession() override;
void Initialize(KClientPort* port_, const std::string& name_);
void Initialize(KClientPort* port_, const std::string& name_,
std::shared_ptr<SessionRequestManager> manager_ = nullptr);
void Finalize() override;