mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-14 12:37:59 -05:00
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:
@ -15,7 +15,8 @@ KSession::KSession(KernelCore& kernel_)
|
||||
: KAutoObjectWithSlabHeapAndContainer{kernel_}, server{kernel_}, client{kernel_} {}
|
||||
KSession::~KSession() = default;
|
||||
|
||||
void KSession::Initialize(KClientPort* port_, const std::string& name_) {
|
||||
void KSession::Initialize(KClientPort* port_, const std::string& name_,
|
||||
std::shared_ptr<SessionRequestManager> manager_) {
|
||||
// Increment reference count.
|
||||
// Because reference count is one on creation, this will result
|
||||
// in a reference count of two. Thus, when both server and client are closed
|
||||
@ -27,7 +28,7 @@ void KSession::Initialize(KClientPort* port_, const std::string& name_) {
|
||||
KAutoObject::Create(std::addressof(client));
|
||||
|
||||
// Initialize our sub sessions.
|
||||
server.Initialize(this, name_ + ":Server");
|
||||
server.Initialize(this, name_ + ":Server", manager_);
|
||||
client.Initialize(this, name_ + ":Client");
|
||||
|
||||
// Set state and name.
|
||||
|
Reference in New Issue
Block a user