mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-12-01 04:57:18 +01:00
fb935fd201
This should prevent filesystem services from blocking other services that don't have their own ServerBase. May improve filesystem related stutters in certain titles. Improves button advanced cutscenes such as Miqol's Request in Xenoblade: DE when the game is on a network share (used to stutter when voice lines played). Should probably be tested to make sure no mysterious bugs have been unearthed, and to see if any other filesystem related perf issues are improved.
23 lines
521 B
C#
23 lines
521 B
C#
using System;
|
|
using System.Threading;
|
|
|
|
namespace Ryujinx.HLE.HOS.Services
|
|
{
|
|
abstract class DisposableIpcService : IpcService, IDisposable
|
|
{
|
|
private int _disposeState;
|
|
|
|
public DisposableIpcService(ServerBase server = null) : base(server) { }
|
|
|
|
protected abstract void Dispose(bool isDisposing);
|
|
|
|
public void Dispose()
|
|
{
|
|
if (Interlocked.CompareExchange(ref _disposeState, 1, 0) == 0)
|
|
{
|
|
Dispose(true);
|
|
}
|
|
}
|
|
}
|
|
}
|