mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-24 05:44:15 +00:00
Unlink server sessions from multi-wait when service stops processing requests (#7072)
This commit is contained in:
parent
2cb80f37d4
commit
ce09450743
3 changed files with 18 additions and 0 deletions
|
@ -21,6 +21,8 @@ namespace Ryujinx.Horizon.Sdk.OsTypes.Impl
|
||||||
|
|
||||||
public long CurrentTime { get; private set; }
|
public long CurrentTime { get; private set; }
|
||||||
|
|
||||||
|
public IEnumerable<MultiWaitHolderBase> MultiWaits => _multiWaits;
|
||||||
|
|
||||||
public MultiWaitImpl()
|
public MultiWaitImpl()
|
||||||
{
|
{
|
||||||
_multiWaits = new List<MultiWaitHolderBase>();
|
_multiWaits = new List<MultiWaitHolderBase>();
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using Ryujinx.Horizon.Sdk.OsTypes.Impl;
|
using Ryujinx.Horizon.Sdk.OsTypes.Impl;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Ryujinx.Horizon.Sdk.OsTypes
|
namespace Ryujinx.Horizon.Sdk.OsTypes
|
||||||
{
|
{
|
||||||
|
@ -6,6 +7,8 @@ namespace Ryujinx.Horizon.Sdk.OsTypes
|
||||||
{
|
{
|
||||||
private readonly MultiWaitImpl _impl;
|
private readonly MultiWaitImpl _impl;
|
||||||
|
|
||||||
|
public IEnumerable<MultiWaitHolderBase> MultiWaits => _impl.MultiWaits;
|
||||||
|
|
||||||
public MultiWait()
|
public MultiWait()
|
||||||
{
|
{
|
||||||
_impl = new MultiWaitImpl();
|
_impl = new MultiWaitImpl();
|
||||||
|
|
|
@ -3,6 +3,7 @@ using Ryujinx.Horizon.Sdk.OsTypes;
|
||||||
using Ryujinx.Horizon.Sdk.Sf.Cmif;
|
using Ryujinx.Horizon.Sdk.Sf.Cmif;
|
||||||
using Ryujinx.Horizon.Sdk.Sm;
|
using Ryujinx.Horizon.Sdk.Sm;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
||||||
{
|
{
|
||||||
|
@ -116,6 +117,18 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
||||||
while (WaitAndProcessRequestsImpl())
|
while (WaitAndProcessRequestsImpl())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unlink pending sessions, dispose expects them to be already unlinked.
|
||||||
|
|
||||||
|
ServerSession[] serverSessions = Enumerable.OfType<ServerSession>(_multiWait.MultiWaits).ToArray();
|
||||||
|
|
||||||
|
foreach (ServerSession serverSession in serverSessions)
|
||||||
|
{
|
||||||
|
if (serverSession.IsLinked)
|
||||||
|
{
|
||||||
|
serverSession.UnlinkFromMultiWaitHolder();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void WaitAndProcessRequests()
|
public void WaitAndProcessRequests()
|
||||||
|
|
Loading…
Reference in a new issue