more Lock

This commit is contained in:
Marco Carvalho
2024-12-03 12:00:40 -03:00
committed by Evan Husted
parent fb32540b6e
commit 938886824e
19 changed files with 34 additions and 33 deletions

View File

@@ -6,6 +6,7 @@ using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
{
@@ -21,7 +22,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
const string CancelText = "Cancel";
const string ControllerToggleText = "Toggle input";
private readonly object _bufferLock = new();
private readonly Lock _bufferLock = new();
private RenderingSurfaceInfo _surfaceInfo = null;
private SKImageInfo _imageInfo;

View File

@@ -40,8 +40,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
public ProcessState State { get; private set; }
private readonly object _processLock = new();
private readonly object _threadingLock = new();
private readonly Lock _processLock = new();
private readonly Lock _threadingLock = new();
public KAddressArbiter AddressArbiter { get; private set; }

View File

@@ -112,7 +112,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
public bool WaitingInArbitration { get; set; }
private readonly object _activityOperationLock = new();
private readonly Lock _activityOperationLock = new();
public KThread(KernelContext context) : base(context)
{

View File

@@ -4,6 +4,7 @@ using Ryujinx.HLE.HOS.Kernel.Threading;
using Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy.Types;
using Ryujinx.Horizon.Common;
using System;
using System.Threading;
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy
{
@@ -17,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
private KEvent _accumulatedSuspendedTickChangedEvent;
private int _accumulatedSuspendedTickChangedEventHandle;
private readonly object _fatalSectionLock = new();
private readonly Lock _fatalSectionLock = new();
private int _fatalSectionCount;
// TODO: Set this when the game goes in suspension (go back to home menu ect), we currently don't support that so we can keep it set to 0.

View File

@@ -18,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm.Proxy
private byte[] _buffer;
private int _bufferEnd;
private readonly object _scanLock = new();
private readonly Lock _scanLock = new();
private Dictionary<ulong, NetworkInfo> _scanResultsLast = new();
private Dictionary<ulong, NetworkInfo> _scanResults = new();

View File

@@ -17,7 +17,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
private readonly Switch _device;
private readonly object _syncpointAllocatorLock = new();
private readonly Lock _syncpointAllocatorLock = new();
public NvHostSyncpt(Switch device)
{

View File

@@ -1,4 +1,5 @@
using Ryujinx.Common;
using System.Threading;
using System.Timers;
namespace Ryujinx.HLE
@@ -20,12 +21,12 @@ namespace Ryujinx.HLE
private readonly long[] _framesRendered;
private readonly double[] _percentTime;
private readonly object[] _frameLock;
private readonly object[] _percentLock;
private readonly Lock[] _frameLock = new[] { new Lock() };
private readonly Lock[] _percentLock = new[] { new Lock() };
private readonly double _ticksToSeconds;
private readonly Timer _resetTimer;
private readonly System.Timers.Timer _resetTimer;
public PerformanceStatistics()
{
@@ -41,10 +42,7 @@ namespace Ryujinx.HLE
_framesRendered = new long[1];
_percentTime = new double[1];
_frameLock = new[] { new object() };
_percentLock = new[] { new object() };
_resetTimer = new Timer(750);
_resetTimer = new(750);
_resetTimer.Elapsed += ResetTimerElapsed;
_resetTimer.AutoReset = true;