From b41f89c3f50a4b3701fe1924cf108581220cea68 Mon Sep 17 00:00:00 2001 From: Marco Carvalho Date: Tue, 3 Dec 2024 10:49:32 -0300 Subject: [PATCH] Migrate to .NET 9 --- Directory.Build.props | 5 +++++ README.md | 4 ++-- global.json | 2 +- src/ARMeilleure/ARMeilleure.csproj | 1 - src/ARMeilleure/Translation/Cache/JitCache.cs | 3 ++- src/ARMeilleure/Translation/PTC/Ptc.cs | 4 +--- src/ARMeilleure/Translation/PTC/PtcProfiler.cs | 4 +--- .../OpenALHardwareDeviceSession.cs | 3 ++- .../Ryujinx.Audio.Backends.OpenAL.csproj | 1 - .../Ryujinx.Audio.Backends.SDL2.csproj | 1 - .../Ryujinx.Audio.Backends.SoundIo.csproj | 1 - src/Ryujinx.Audio/AudioManager.cs | 2 +- src/Ryujinx.Audio/Backends/Common/DynamicRingBuffer.cs | 3 ++- src/Ryujinx.Audio/Input/AudioInputManager.cs | 2 +- src/Ryujinx.Audio/Input/AudioInputSystem.cs | 4 ++-- src/Ryujinx.Audio/Output/AudioOutputManager.cs | 2 +- src/Ryujinx.Audio/Output/AudioOutputSystem.cs | 4 ++-- src/Ryujinx.Audio/Renderer/Server/AudioRenderSystem.cs | 2 +- .../Renderer/Server/Upsampler/UpsamplerManager.cs | 3 ++- src/Ryujinx.Audio/Ryujinx.Audio.csproj | 1 - src/Ryujinx.Common/PreciseSleep/NanosleepPool.cs | 2 +- src/Ryujinx.Common/PreciseSleep/WindowsGranularTimer.cs | 2 +- src/Ryujinx.Common/Ryujinx.Common.csproj | 1 - src/Ryujinx.Cpu/AppleHv/HvVm.cs | 3 ++- src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs | 3 ++- src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs | 4 ++-- src/Ryujinx.Cpu/Ryujinx.Cpu.csproj | 1 - src/Ryujinx.Cpu/Signal/NativeSignalHandler.cs | 3 ++- src/Ryujinx.Graphics.Device/Ryujinx.Graphics.Device.csproj | 1 - src/Ryujinx.Graphics.GAL/Ryujinx.Graphics.GAL.csproj | 1 - src/Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs | 5 +++-- src/Ryujinx.Graphics.Gpu/Ryujinx.Graphics.Gpu.csproj | 1 - src/Ryujinx.Graphics.Host1x/Ryujinx.Graphics.Host1x.csproj | 1 - .../Ryujinx.Graphics.Nvdec.FFmpeg.csproj | 1 - .../Ryujinx.Graphics.Nvdec.Vp9.csproj | 1 - src/Ryujinx.Graphics.Nvdec/Ryujinx.Graphics.Nvdec.csproj | 1 - src/Ryujinx.Graphics.OpenGL/Queries/CounterQueue.cs | 2 +- src/Ryujinx.Graphics.OpenGL/Queries/CounterQueueEvent.cs | 2 +- src/Ryujinx.Graphics.OpenGL/ResourcePool.cs | 3 ++- src/Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj | 1 - src/Ryujinx.Graphics.Shader/Ryujinx.Graphics.Shader.csproj | 1 - .../Ryujinx.Graphics.Texture.csproj | 1 - src/Ryujinx.Graphics.Vic/Ryujinx.Graphics.Vic.csproj | 1 - src/Ryujinx.Graphics.Video/Ryujinx.Graphics.Video.csproj | 1 - src/Ryujinx.Graphics.Vulkan/HostMemoryAllocator.cs | 3 ++- src/Ryujinx.Graphics.Vulkan/Queries/CounterQueue.cs | 2 +- src/Ryujinx.Graphics.Vulkan/Queries/CounterQueueEvent.cs | 2 +- src/Ryujinx.Graphics.Vulkan/Ryujinx.Graphics.Vulkan.csproj | 1 - src/Ryujinx.HLE/FileSystem/ContentManager.cs | 5 +++-- .../HOS/Applets/SoftwareKeyboard/SoftwareKeyboardApplet.cs | 3 ++- src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs | 2 +- src/Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs | 5 ++--- src/Ryujinx.HLE/HOS/Kernel/Memory/KCodeMemory.cs | 4 ++-- src/Ryujinx.HLE/HOS/Kernel/Threading/KCriticalSection.cs | 3 +-- src/Ryujinx.HLE/HOS/Services/Ldn/Types/NodeLatestUpdate.cs | 3 ++- .../Services/Ldn/UserServiceCreator/LdnMitm/LanDiscovery.cs | 2 +- .../Ldn/UserServiceCreator/LdnRyu/NetworkTimeout.cs | 2 +- .../UserServiceCreator/LdnRyu/Proxy/EphemeralPortPool.cs | 3 ++- src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs | 3 ++- .../HOS/Services/Ssl/BuiltInCertificateManager.cs | 3 ++- .../HOS/Services/SurfaceFlinger/HOSBinderDriverServer.cs | 3 ++- .../HOS/Services/SurfaceFlinger/SurfaceFlinger.cs | 2 +- .../HOS/Services/Time/TimeZone/TimeZoneManager.cs | 3 ++- src/Ryujinx.HLE/Ryujinx.HLE.csproj | 1 - src/Ryujinx.Headless.SDL2/Ryujinx.Headless.SDL2.csproj | 1 - src/Ryujinx.Horizon.Common/Ryujinx.Horizon.Common.csproj | 1 - src/Ryujinx.Horizon/Ryujinx.Horizon.csproj | 1 - .../Sdk/Friends/Detail/Ipc/NotificationService.cs | 3 ++- src/Ryujinx.Horizon/Sdk/Ngc/Detail/ContentsReader.cs | 4 ++-- src/Ryujinx.Horizon/Sdk/OsTypes/Impl/MultiWaitImpl.cs | 3 ++- src/Ryujinx.Input.SDL2/Ryujinx.Input.SDL2.csproj | 1 - src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs | 3 ++- src/Ryujinx.Input/HLE/NpadManager.cs | 3 ++- src/Ryujinx.Input/Ryujinx.Input.csproj | 1 - src/Ryujinx.Memory/Ryujinx.Memory.csproj | 1 - src/Ryujinx.SDL2.Common/Ryujinx.SDL2.Common.csproj | 1 - src/Ryujinx.SDL2.Common/SDL2Driver.cs | 2 +- src/Ryujinx.ShaderTools/Ryujinx.ShaderTools.csproj | 1 - src/Ryujinx.Tests.Memory/Ryujinx.Tests.Memory.csproj | 1 - src/Ryujinx.Tests.Unicorn/Ryujinx.Tests.Unicorn.csproj | 1 - src/Ryujinx.Tests/Ryujinx.Tests.csproj | 1 - src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj | 1 - src/Ryujinx/AppHost.cs | 6 +++--- src/Ryujinx/Ryujinx.csproj | 1 - src/Spv.Generator/Spv.Generator.csproj | 1 - 85 files changed, 87 insertions(+), 101 deletions(-) create mode 100644 Directory.Build.props diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 000000000..67b2324e3 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,5 @@ + + + net9.0 + + diff --git a/README.md b/README.md index f6783b412..5089fd59d 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ failing to meet this requirement may result in a poor gameplay experience or une ## Latest build -Stable builds are made every so often onto a separate "release" branch that then gets put into the releases you know and love. +Stable builds are made every so often onto a separate "release" branch that then gets put into the releases you know and love. These stable builds exist so that the end user can get a more **enjoyable and stable experience**. You can find the latest stable release [here](https://github.com/GreemDev/Ryujinx/releases/latest). @@ -91,7 +91,7 @@ If you are planning to contribute or just want to learn more about this project It translates the ARM code to a custom IR, performs a few optimizations, and turns that into x86 code. There are three memory manager options available depending on the user's preference, leveraging both software-based (slower) and host-mapped modes (much faster). The fastest option (host, unchecked) is set by default. - Ryujinx also features an optional Profiled Persistent Translation Cache, which essentially caches translated functions so that they do not need to be translated every time the game loads. + Ryujinx also features an optional Profiled Persistent Translation Cache, which essentially caches translated functions so that they do not need to be translated every time the game loads. The net result is a significant reduction in load times (the amount of time between launching a game and arriving at the title screen) for nearly every game. NOTE: This feature is enabled by default in the Options menu > System tab. You must launch the game at least twice to the title screen or beyond before performance improvements are unlocked on the third launch! diff --git a/global.json b/global.json index 391ba3c2a..cdbb589ed 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "9.0.100", "rollForward": "latestFeature" } } diff --git a/src/ARMeilleure/ARMeilleure.csproj b/src/ARMeilleure/ARMeilleure.csproj index 4b67fdb3b..5b6c5a6da 100644 --- a/src/ARMeilleure/ARMeilleure.csproj +++ b/src/ARMeilleure/ARMeilleure.csproj @@ -1,7 +1,6 @@ - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/ARMeilleure/Translation/Cache/JitCache.cs b/src/ARMeilleure/Translation/Cache/JitCache.cs index cf13cd6cb..3bbec482c 100644 --- a/src/ARMeilleure/Translation/Cache/JitCache.cs +++ b/src/ARMeilleure/Translation/Cache/JitCache.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Runtime.InteropServices; using System.Runtime.Versioning; +using System.Threading; namespace ARMeilleure.Translation.Cache { @@ -26,7 +27,7 @@ namespace ARMeilleure.Translation.Cache private static readonly List _cacheEntries = new(); - private static readonly object _lock = new(); + private static readonly Lock _lock = new(); private static bool _initialized; [SupportedOSPlatform("windows")] diff --git a/src/ARMeilleure/Translation/PTC/Ptc.cs b/src/ARMeilleure/Translation/PTC/Ptc.cs index 841e5fefa..4675abc49 100644 --- a/src/ARMeilleure/Translation/PTC/Ptc.cs +++ b/src/ARMeilleure/Translation/PTC/Ptc.cs @@ -59,7 +59,7 @@ namespace ARMeilleure.Translation.PTC private readonly ManualResetEvent _waitEvent; - private readonly object _lock; + private readonly Lock _lock = new(); private bool _disposed; @@ -89,8 +89,6 @@ namespace ARMeilleure.Translation.PTC _waitEvent = new ManualResetEvent(true); - _lock = new object(); - _disposed = false; TitleIdText = TitleIdTextDefault; diff --git a/src/ARMeilleure/Translation/PTC/PtcProfiler.cs b/src/ARMeilleure/Translation/PTC/PtcProfiler.cs index 8e95c5e4b..7e630ae10 100644 --- a/src/ARMeilleure/Translation/PTC/PtcProfiler.cs +++ b/src/ARMeilleure/Translation/PTC/PtcProfiler.cs @@ -41,7 +41,7 @@ namespace ARMeilleure.Translation.PTC private readonly ManualResetEvent _waitEvent; - private readonly object _lock; + private readonly Lock _lock = new(); private bool _disposed; @@ -65,8 +65,6 @@ namespace ARMeilleure.Translation.PTC _waitEvent = new ManualResetEvent(true); - _lock = new object(); - _disposed = false; ProfiledFuncs = new Dictionary(); diff --git a/src/Ryujinx.Audio.Backends.OpenAL/OpenALHardwareDeviceSession.cs b/src/Ryujinx.Audio.Backends.OpenAL/OpenALHardwareDeviceSession.cs index 3b9129130..7292450a6 100644 --- a/src/Ryujinx.Audio.Backends.OpenAL/OpenALHardwareDeviceSession.cs +++ b/src/Ryujinx.Audio.Backends.OpenAL/OpenALHardwareDeviceSession.cs @@ -5,6 +5,7 @@ using Ryujinx.Memory; using System; using System.Collections.Generic; using System.Diagnostics; +using System.Threading; namespace Ryujinx.Audio.Backends.OpenAL { @@ -18,7 +19,7 @@ namespace Ryujinx.Audio.Backends.OpenAL private ulong _playedSampleCount; private float _volume; - private readonly object _lock = new(); + private readonly Lock _lock = new(); public OpenALHardwareDeviceSession(OpenALHardwareDeviceDriver driver, IVirtualMemoryManager memoryManager, SampleFormat requestedSampleFormat, uint requestedSampleRate, uint requestedChannelCount) : base(memoryManager, requestedSampleFormat, requestedSampleRate, requestedChannelCount) { diff --git a/src/Ryujinx.Audio.Backends.OpenAL/Ryujinx.Audio.Backends.OpenAL.csproj b/src/Ryujinx.Audio.Backends.OpenAL/Ryujinx.Audio.Backends.OpenAL.csproj index bdf46d688..4ef3aebec 100644 --- a/src/Ryujinx.Audio.Backends.OpenAL/Ryujinx.Audio.Backends.OpenAL.csproj +++ b/src/Ryujinx.Audio.Backends.OpenAL/Ryujinx.Audio.Backends.OpenAL.csproj @@ -1,7 +1,6 @@ - net8.0 $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Audio.Backends.SDL2/Ryujinx.Audio.Backends.SDL2.csproj b/src/Ryujinx.Audio.Backends.SDL2/Ryujinx.Audio.Backends.SDL2.csproj index 940e47308..d0d45122e 100644 --- a/src/Ryujinx.Audio.Backends.SDL2/Ryujinx.Audio.Backends.SDL2.csproj +++ b/src/Ryujinx.Audio.Backends.SDL2/Ryujinx.Audio.Backends.SDL2.csproj @@ -1,7 +1,6 @@ - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Audio.Backends.SoundIo/Ryujinx.Audio.Backends.SoundIo.csproj b/src/Ryujinx.Audio.Backends.SoundIo/Ryujinx.Audio.Backends.SoundIo.csproj index 671a6ad5e..d06f66181 100644 --- a/src/Ryujinx.Audio.Backends.SoundIo/Ryujinx.Audio.Backends.SoundIo.csproj +++ b/src/Ryujinx.Audio.Backends.SoundIo/Ryujinx.Audio.Backends.SoundIo.csproj @@ -1,7 +1,6 @@ - net8.0 true win-x64;osx-x64;linux-x64 $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Audio/AudioManager.cs b/src/Ryujinx.Audio/AudioManager.cs index 370d3d098..8c2c0ef6b 100644 --- a/src/Ryujinx.Audio/AudioManager.cs +++ b/src/Ryujinx.Audio/AudioManager.cs @@ -11,7 +11,7 @@ namespace Ryujinx.Audio /// /// Lock used to control the waiters registration. /// - private readonly object _lock = new(); + private readonly Lock _lock = new(); /// /// Events signaled when the driver played audio buffers. diff --git a/src/Ryujinx.Audio/Backends/Common/DynamicRingBuffer.cs b/src/Ryujinx.Audio/Backends/Common/DynamicRingBuffer.cs index 7aefe8865..6f31755a3 100644 --- a/src/Ryujinx.Audio/Backends/Common/DynamicRingBuffer.cs +++ b/src/Ryujinx.Audio/Backends/Common/DynamicRingBuffer.cs @@ -2,6 +2,7 @@ using Ryujinx.Common; using Ryujinx.Common.Memory; using System; using System.Buffers; +using System.Threading; namespace Ryujinx.Audio.Backends.Common { @@ -12,7 +13,7 @@ namespace Ryujinx.Audio.Backends.Common { private const int RingBufferAlignment = 2048; - private readonly object _lock = new(); + private readonly Lock _lock = new(); private MemoryOwner _bufferOwner; private Memory _buffer; diff --git a/src/Ryujinx.Audio/Input/AudioInputManager.cs b/src/Ryujinx.Audio/Input/AudioInputManager.cs index d56997e9c..4f948673c 100644 --- a/src/Ryujinx.Audio/Input/AudioInputManager.cs +++ b/src/Ryujinx.Audio/Input/AudioInputManager.cs @@ -14,7 +14,7 @@ namespace Ryujinx.Audio.Input /// public class AudioInputManager : IDisposable { - private readonly object _lock = new(); + private readonly Lock _lock = new(); /// /// Lock used for session allocation. diff --git a/src/Ryujinx.Audio/Input/AudioInputSystem.cs b/src/Ryujinx.Audio/Input/AudioInputSystem.cs index 34623b34f..65b99745d 100644 --- a/src/Ryujinx.Audio/Input/AudioInputSystem.cs +++ b/src/Ryujinx.Audio/Input/AudioInputSystem.cs @@ -48,7 +48,7 @@ namespace Ryujinx.Audio.Input /// /// The lock of the parent. /// - private readonly object _parentLock; + private readonly Lock _parentLock; /// /// The dispose state. @@ -62,7 +62,7 @@ namespace Ryujinx.Audio.Input /// The lock of the manager /// The hardware device session /// The buffer release event of the audio input - public AudioInputSystem(AudioInputManager manager, object parentLock, IHardwareDeviceSession deviceSession, IWritableEvent bufferEvent) + public AudioInputSystem(AudioInputManager manager, Lock parentLock, IHardwareDeviceSession deviceSession, IWritableEvent bufferEvent) { _manager = manager; _parentLock = parentLock; diff --git a/src/Ryujinx.Audio/Output/AudioOutputManager.cs b/src/Ryujinx.Audio/Output/AudioOutputManager.cs index 308cd1564..4ba3fa111 100644 --- a/src/Ryujinx.Audio/Output/AudioOutputManager.cs +++ b/src/Ryujinx.Audio/Output/AudioOutputManager.cs @@ -14,7 +14,7 @@ namespace Ryujinx.Audio.Output /// public class AudioOutputManager : IDisposable { - private readonly object _lock = new(); + private readonly Lock _lock = new(); /// /// Lock used for session allocation. diff --git a/src/Ryujinx.Audio/Output/AudioOutputSystem.cs b/src/Ryujinx.Audio/Output/AudioOutputSystem.cs index f9b9bdcf1..dc7d52ced 100644 --- a/src/Ryujinx.Audio/Output/AudioOutputSystem.cs +++ b/src/Ryujinx.Audio/Output/AudioOutputSystem.cs @@ -48,7 +48,7 @@ namespace Ryujinx.Audio.Output /// /// THe lock of the parent. /// - private readonly object _parentLock; + private readonly Lock _parentLock; /// /// The dispose state. @@ -62,7 +62,7 @@ namespace Ryujinx.Audio.Output /// The lock of the manager /// The hardware device session /// The buffer release event of the audio output - public AudioOutputSystem(AudioOutputManager manager, object parentLock, IHardwareDeviceSession deviceSession, IWritableEvent bufferEvent) + public AudioOutputSystem(AudioOutputManager manager, Lock parentLock, IHardwareDeviceSession deviceSession, IWritableEvent bufferEvent) { _manager = manager; _parentLock = parentLock; diff --git a/src/Ryujinx.Audio/Renderer/Server/AudioRenderSystem.cs b/src/Ryujinx.Audio/Renderer/Server/AudioRenderSystem.cs index 246889c48..65a134af1 100644 --- a/src/Ryujinx.Audio/Renderer/Server/AudioRenderSystem.cs +++ b/src/Ryujinx.Audio/Renderer/Server/AudioRenderSystem.cs @@ -26,7 +26,7 @@ namespace Ryujinx.Audio.Renderer.Server { public class AudioRenderSystem : IDisposable { - private readonly object _lock = new(); + private readonly Lock _lock = new(); private AudioRendererRenderingDevice _renderingDevice; private AudioRendererExecutionMode _executionMode; diff --git a/src/Ryujinx.Audio/Renderer/Server/Upsampler/UpsamplerManager.cs b/src/Ryujinx.Audio/Renderer/Server/Upsampler/UpsamplerManager.cs index dbc2c9b3f..8b3f39439 100644 --- a/src/Ryujinx.Audio/Renderer/Server/Upsampler/UpsamplerManager.cs +++ b/src/Ryujinx.Audio/Renderer/Server/Upsampler/UpsamplerManager.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Threading; namespace Ryujinx.Audio.Renderer.Server.Upsampler { @@ -16,7 +17,7 @@ namespace Ryujinx.Audio.Renderer.Server.Upsampler /// /// Global lock of the object. /// - private readonly object _lock = new(); + private readonly Lock _lock = new(); /// /// The upsamplers instances. diff --git a/src/Ryujinx.Audio/Ryujinx.Audio.csproj b/src/Ryujinx.Audio/Ryujinx.Audio.csproj index 8901bbf59..92e0fe93f 100644 --- a/src/Ryujinx.Audio/Ryujinx.Audio.csproj +++ b/src/Ryujinx.Audio/Ryujinx.Audio.csproj @@ -1,7 +1,6 @@  - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Common/PreciseSleep/NanosleepPool.cs b/src/Ryujinx.Common/PreciseSleep/NanosleepPool.cs index c0973dcb3..45b8e95fa 100644 --- a/src/Ryujinx.Common/PreciseSleep/NanosleepPool.cs +++ b/src/Ryujinx.Common/PreciseSleep/NanosleepPool.cs @@ -124,7 +124,7 @@ namespace Ryujinx.Common.PreciseSleep } } - private readonly object _lock = new(); + private readonly Lock _lock = new(); private readonly List _threads = new(); private readonly List _active = new(); private readonly Stack _free = new(); diff --git a/src/Ryujinx.Common/PreciseSleep/WindowsGranularTimer.cs b/src/Ryujinx.Common/PreciseSleep/WindowsGranularTimer.cs index 3bf092704..cef4dc927 100644 --- a/src/Ryujinx.Common/PreciseSleep/WindowsGranularTimer.cs +++ b/src/Ryujinx.Common/PreciseSleep/WindowsGranularTimer.cs @@ -50,7 +50,7 @@ namespace Ryujinx.Common.SystemInterop private long _lastTicks = PerformanceCounter.ElapsedTicks; private long _lastId; - private readonly object _lock = new(); + private readonly Lock _lock = new(); private readonly List _waitingObjects = new(); private WindowsGranularTimer() diff --git a/src/Ryujinx.Common/Ryujinx.Common.csproj b/src/Ryujinx.Common/Ryujinx.Common.csproj index 85d4b58bd..de163aae7 100644 --- a/src/Ryujinx.Common/Ryujinx.Common.csproj +++ b/src/Ryujinx.Common/Ryujinx.Common.csproj @@ -1,7 +1,6 @@ - net8.0 true $(DefineConstants);$(ExtraDefineConstants) $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Cpu/AppleHv/HvVm.cs b/src/Ryujinx.Cpu/AppleHv/HvVm.cs index a12bbea9b..b4d45f36d 100644 --- a/src/Ryujinx.Cpu/AppleHv/HvVm.cs +++ b/src/Ryujinx.Cpu/AppleHv/HvVm.cs @@ -1,6 +1,7 @@ using Ryujinx.Memory; using System; using System.Runtime.Versioning; +using System.Threading; namespace Ryujinx.Cpu.AppleHv { @@ -12,7 +13,7 @@ namespace Ryujinx.Cpu.AppleHv private static int _addressSpaces; private static HvIpaAllocator _ipaAllocator; - private static readonly object _lock = new(); + private static readonly Lock _lock = new(); public static (ulong, HvIpaAllocator) CreateAddressSpace(MemoryBlock block) { diff --git a/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs b/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs index ac1274bf6..10ae050b6 100644 --- a/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs +++ b/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Runtime.InteropServices; using System.Runtime.Versioning; +using System.Threading; namespace Ryujinx.Cpu.LightningJit.Cache { @@ -23,7 +24,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache private static readonly List _cacheEntries = new(); - private static readonly object _lock = new(); + private static readonly Lock _lock = new(); private static bool _initialized; [SupportedOSPlatform("windows")] diff --git a/src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs b/src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs index 3cf279ae3..e9a342aba 100644 --- a/src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs +++ b/src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs @@ -4,6 +4,7 @@ using Ryujinx.Memory; using System; using System.Collections.Generic; using System.Diagnostics; +using System.Threading; namespace Ryujinx.Cpu.LightningJit.Cache { @@ -104,7 +105,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache private readonly MemoryCache _sharedCache; private readonly MemoryCache _localCache; private readonly PageAlignedRangeList _pendingMap; - private readonly object _lock; + private readonly Lock _lock = new(); class ThreadLocalCacheEntry { @@ -137,7 +138,6 @@ namespace Ryujinx.Cpu.LightningJit.Cache _sharedCache = new(allocator, SharedCacheSize); _localCache = new(allocator, LocalCacheSize); _pendingMap = new(_sharedCache.ReprotectAsRx, RegisterFunction); - _lock = new(); } public unsafe nint Map(nint framePointer, ReadOnlySpan code, ulong guestAddress, ulong guestSize) diff --git a/src/Ryujinx.Cpu/Ryujinx.Cpu.csproj b/src/Ryujinx.Cpu/Ryujinx.Cpu.csproj index 0a55a7dea..e58a2ce97 100644 --- a/src/Ryujinx.Cpu/Ryujinx.Cpu.csproj +++ b/src/Ryujinx.Cpu/Ryujinx.Cpu.csproj @@ -1,7 +1,6 @@  - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Cpu/Signal/NativeSignalHandler.cs b/src/Ryujinx.Cpu/Signal/NativeSignalHandler.cs index 2985f1c21..75a6d3bf8 100644 --- a/src/Ryujinx.Cpu/Signal/NativeSignalHandler.cs +++ b/src/Ryujinx.Cpu/Signal/NativeSignalHandler.cs @@ -5,6 +5,7 @@ using System; using System.Diagnostics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Threading; namespace Ryujinx.Cpu.Signal { @@ -59,7 +60,7 @@ namespace Ryujinx.Cpu.Signal private static MemoryBlock _codeBlock; - private static readonly object _lock = new(); + private static readonly Lock _lock = new(); private static bool _initialized; static NativeSignalHandler() diff --git a/src/Ryujinx.Graphics.Device/Ryujinx.Graphics.Device.csproj b/src/Ryujinx.Graphics.Device/Ryujinx.Graphics.Device.csproj index 58f54de7d..cbe276355 100644 --- a/src/Ryujinx.Graphics.Device/Ryujinx.Graphics.Device.csproj +++ b/src/Ryujinx.Graphics.Device/Ryujinx.Graphics.Device.csproj @@ -1,7 +1,6 @@  - net8.0 $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Graphics.GAL/Ryujinx.Graphics.GAL.csproj b/src/Ryujinx.Graphics.GAL/Ryujinx.Graphics.GAL.csproj index a230296c1..b94a4ec90 100644 --- a/src/Ryujinx.Graphics.GAL/Ryujinx.Graphics.GAL.csproj +++ b/src/Ryujinx.Graphics.GAL/Ryujinx.Graphics.GAL.csproj @@ -1,7 +1,6 @@  - net8.0 $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs b/src/Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs index d330de638..c5a12c1fc 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs @@ -2,6 +2,7 @@ using Ryujinx.Common.Pools; using Ryujinx.Memory.Range; using System; using System.Linq; +using System.Threading; namespace Ryujinx.Graphics.Gpu.Memory { @@ -76,7 +77,7 @@ namespace Ryujinx.Graphics.Gpu.Memory private BufferMigration _source; private BufferModifiedRangeList _migrationTarget; - private readonly object _lock = new(); + private readonly Lock _lock = new(); /// /// Whether the modified range list has any entries or not. @@ -435,7 +436,7 @@ namespace Ryujinx.Graphics.Gpu.Memory if (_source == null) { - // Create a new migration. + // Create a new migration. _source = new BufferMigration(new BufferMigrationSpan[] { span }, this, _context.SyncNumber); _context.RegisterBufferMigration(_source); diff --git a/src/Ryujinx.Graphics.Gpu/Ryujinx.Graphics.Gpu.csproj b/src/Ryujinx.Graphics.Gpu/Ryujinx.Graphics.Gpu.csproj index 8c740fadc..4cd9c1d5c 100644 --- a/src/Ryujinx.Graphics.Gpu/Ryujinx.Graphics.Gpu.csproj +++ b/src/Ryujinx.Graphics.Gpu/Ryujinx.Graphics.Gpu.csproj @@ -1,7 +1,6 @@  - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Graphics.Host1x/Ryujinx.Graphics.Host1x.csproj b/src/Ryujinx.Graphics.Host1x/Ryujinx.Graphics.Host1x.csproj index 92077e26a..3000d41de 100644 --- a/src/Ryujinx.Graphics.Host1x/Ryujinx.Graphics.Host1x.csproj +++ b/src/Ryujinx.Graphics.Host1x/Ryujinx.Graphics.Host1x.csproj @@ -1,7 +1,6 @@ - net8.0 $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Graphics.Nvdec.FFmpeg/Ryujinx.Graphics.Nvdec.FFmpeg.csproj b/src/Ryujinx.Graphics.Nvdec.FFmpeg/Ryujinx.Graphics.Nvdec.FFmpeg.csproj index 7659c4b25..9e250d171 100644 --- a/src/Ryujinx.Graphics.Nvdec.FFmpeg/Ryujinx.Graphics.Nvdec.FFmpeg.csproj +++ b/src/Ryujinx.Graphics.Nvdec.FFmpeg/Ryujinx.Graphics.Nvdec.FFmpeg.csproj @@ -1,7 +1,6 @@  - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Graphics.Nvdec.Vp9/Ryujinx.Graphics.Nvdec.Vp9.csproj b/src/Ryujinx.Graphics.Nvdec.Vp9/Ryujinx.Graphics.Nvdec.Vp9.csproj index 7659c4b25..9e250d171 100644 --- a/src/Ryujinx.Graphics.Nvdec.Vp9/Ryujinx.Graphics.Nvdec.Vp9.csproj +++ b/src/Ryujinx.Graphics.Nvdec.Vp9/Ryujinx.Graphics.Nvdec.Vp9.csproj @@ -1,7 +1,6 @@  - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Graphics.Nvdec/Ryujinx.Graphics.Nvdec.csproj b/src/Ryujinx.Graphics.Nvdec/Ryujinx.Graphics.Nvdec.csproj index 7a13b5d1b..d020ae50e 100644 --- a/src/Ryujinx.Graphics.Nvdec/Ryujinx.Graphics.Nvdec.csproj +++ b/src/Ryujinx.Graphics.Nvdec/Ryujinx.Graphics.Nvdec.csproj @@ -1,7 +1,6 @@  - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueue.cs b/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueue.cs index 345a99ffa..7e0311407 100644 --- a/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueue.cs +++ b/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueue.cs @@ -19,7 +19,7 @@ namespace Ryujinx.Graphics.OpenGL.Queries private ulong _accumulatedCounter; private int _waiterCount; - private readonly object _lock = new(); + private readonly Lock _lock = new(); private readonly Queue _queryPool; private readonly AutoResetEvent _queuedEvent = new(false); diff --git a/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueueEvent.cs b/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueueEvent.cs index 32b75c615..889517480 100644 --- a/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueueEvent.cs +++ b/src/Ryujinx.Graphics.OpenGL/Queries/CounterQueueEvent.cs @@ -24,7 +24,7 @@ namespace Ryujinx.Graphics.OpenGL.Queries private bool _hostAccessReserved = false; private int _refCount = 1; // Starts with a reference from the counter queue. - private readonly object _lock = new(); + private readonly Lock _lock = new(); private ulong _result = ulong.MaxValue; private double _divisor = 1f; diff --git a/src/Ryujinx.Graphics.OpenGL/ResourcePool.cs b/src/Ryujinx.Graphics.OpenGL/ResourcePool.cs index 6385f57b5..c8ff30a07 100644 --- a/src/Ryujinx.Graphics.OpenGL/ResourcePool.cs +++ b/src/Ryujinx.Graphics.OpenGL/ResourcePool.cs @@ -2,6 +2,7 @@ using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.OpenGL.Image; using System; using System.Collections.Generic; +using System.Threading; namespace Ryujinx.Graphics.OpenGL { @@ -19,7 +20,7 @@ namespace Ryujinx.Graphics.OpenGL { private const int DisposedLiveFrames = 2; - private readonly object _lock = new(); + private readonly Lock _lock = new(); private readonly Dictionary> _textures = new(); /// diff --git a/src/Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj b/src/Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj index 931e70c03..47cec29e2 100644 --- a/src/Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj +++ b/src/Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj @@ -1,7 +1,6 @@ - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Graphics.Shader/Ryujinx.Graphics.Shader.csproj b/src/Ryujinx.Graphics.Shader/Ryujinx.Graphics.Shader.csproj index be32641eb..cfb188daf 100644 --- a/src/Ryujinx.Graphics.Shader/Ryujinx.Graphics.Shader.csproj +++ b/src/Ryujinx.Graphics.Shader/Ryujinx.Graphics.Shader.csproj @@ -1,7 +1,6 @@ - net8.0 $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Graphics.Texture/Ryujinx.Graphics.Texture.csproj b/src/Ryujinx.Graphics.Texture/Ryujinx.Graphics.Texture.csproj index 48d10f1d5..2b4445aeb 100644 --- a/src/Ryujinx.Graphics.Texture/Ryujinx.Graphics.Texture.csproj +++ b/src/Ryujinx.Graphics.Texture/Ryujinx.Graphics.Texture.csproj @@ -1,6 +1,5 @@ - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Graphics.Vic/Ryujinx.Graphics.Vic.csproj b/src/Ryujinx.Graphics.Vic/Ryujinx.Graphics.Vic.csproj index 820e807e6..5505a3aa1 100644 --- a/src/Ryujinx.Graphics.Vic/Ryujinx.Graphics.Vic.csproj +++ b/src/Ryujinx.Graphics.Vic/Ryujinx.Graphics.Vic.csproj @@ -1,7 +1,6 @@ - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Graphics.Video/Ryujinx.Graphics.Video.csproj b/src/Ryujinx.Graphics.Video/Ryujinx.Graphics.Video.csproj index d85effe32..d64990f82 100644 --- a/src/Ryujinx.Graphics.Video/Ryujinx.Graphics.Video.csproj +++ b/src/Ryujinx.Graphics.Video/Ryujinx.Graphics.Video.csproj @@ -1,7 +1,6 @@ - net8.0 $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Graphics.Vulkan/HostMemoryAllocator.cs b/src/Ryujinx.Graphics.Vulkan/HostMemoryAllocator.cs index 77c5f95c9..5c8b2a761 100644 --- a/src/Ryujinx.Graphics.Vulkan/HostMemoryAllocator.cs +++ b/src/Ryujinx.Graphics.Vulkan/HostMemoryAllocator.cs @@ -5,6 +5,7 @@ using Silk.NET.Vulkan; using Silk.NET.Vulkan.Extensions.EXT; using System; using System.Collections.Generic; +using System.Threading; namespace Ryujinx.Graphics.Vulkan { @@ -31,7 +32,7 @@ namespace Ryujinx.Graphics.Vulkan private readonly Vk _api; private readonly ExtExternalMemoryHost _hostMemoryApi; private readonly Device _device; - private readonly object _lock = new(); + private readonly Lock _lock = new(); private readonly List _allocations; private readonly IntervalTree _allocationTree; diff --git a/src/Ryujinx.Graphics.Vulkan/Queries/CounterQueue.cs b/src/Ryujinx.Graphics.Vulkan/Queries/CounterQueue.cs index 0d133e50e..fa10f13b9 100644 --- a/src/Ryujinx.Graphics.Vulkan/Queries/CounterQueue.cs +++ b/src/Ryujinx.Graphics.Vulkan/Queries/CounterQueue.cs @@ -24,7 +24,7 @@ namespace Ryujinx.Graphics.Vulkan.Queries private ulong _accumulatedCounter; private int _waiterCount; - private readonly object _lock = new(); + private readonly Lock _lock = new(); private readonly Queue _queryPool; private readonly AutoResetEvent _queuedEvent = new(false); diff --git a/src/Ryujinx.Graphics.Vulkan/Queries/CounterQueueEvent.cs b/src/Ryujinx.Graphics.Vulkan/Queries/CounterQueueEvent.cs index 14d3050bf..0bac3be12 100644 --- a/src/Ryujinx.Graphics.Vulkan/Queries/CounterQueueEvent.cs +++ b/src/Ryujinx.Graphics.Vulkan/Queries/CounterQueueEvent.cs @@ -22,7 +22,7 @@ namespace Ryujinx.Graphics.Vulkan.Queries private bool _hostAccessReserved; private int _refCount = 1; // Starts with a reference from the counter queue. - private readonly object _lock = new(); + private readonly Lock _lock = new(); private ulong _result = ulong.MaxValue; private double _divisor = 1f; diff --git a/src/Ryujinx.Graphics.Vulkan/Ryujinx.Graphics.Vulkan.csproj b/src/Ryujinx.Graphics.Vulkan/Ryujinx.Graphics.Vulkan.csproj index b138e309a..5481e57f2 100644 --- a/src/Ryujinx.Graphics.Vulkan/Ryujinx.Graphics.Vulkan.csproj +++ b/src/Ryujinx.Graphics.Vulkan/Ryujinx.Graphics.Vulkan.csproj @@ -1,7 +1,6 @@ - net8.0 $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.HLE/FileSystem/ContentManager.cs b/src/Ryujinx.HLE/FileSystem/ContentManager.cs index 51f6058fc..f5a44dcaf 100644 --- a/src/Ryujinx.HLE/FileSystem/ContentManager.cs +++ b/src/Ryujinx.HLE/FileSystem/ContentManager.cs @@ -22,6 +22,7 @@ using System.IO.Compression; using System.Linq; using System.Text; using System.Text.RegularExpressions; +using System.Threading; using Path = System.IO.Path; namespace Ryujinx.HLE.FileSystem @@ -55,7 +56,7 @@ namespace Ryujinx.HLE.FileSystem private readonly VirtualFileSystem _virtualFileSystem; - private readonly object _lock = new(); + private readonly Lock _lock = new(); public ContentManager(VirtualFileSystem virtualFileSystem) { @@ -1076,7 +1077,7 @@ namespace Ryujinx.HLE.FileSystem { if (File.Exists(Path.Combine(pathToCheck, file))) { - return true; + return true; } } return false; diff --git a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardApplet.cs b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardApplet.cs index e04fc64fe..9e129f0d2 100644 --- a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardApplet.cs +++ b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/SoftwareKeyboardApplet.cs @@ -14,6 +14,7 @@ using System.IO; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; +using System.Threading; namespace Ryujinx.HLE.HOS.Applets { @@ -62,7 +63,7 @@ namespace Ryujinx.HLE.HOS.Applets private bool _canAcceptController = false; private KeyboardInputMode _inputMode = KeyboardInputMode.ControllerAndKeyboard; - private readonly object _lock = new(); + private readonly Lock _lock = new(); public event EventHandler AppletStateChanged; diff --git a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs index 3eaf64596..a8b137df2 100644 --- a/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs +++ b/src/Ryujinx.HLE/HOS/Applets/SoftwareKeyboard/TimedAction.cs @@ -27,7 +27,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard private TRef _cancelled = null; private Thread _thread = null; - private readonly object _lock = new(); + private readonly Lock _lock = new(); public bool IsRunning { diff --git a/src/Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs b/src/Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs index 3f16f8c24..90231b460 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs @@ -2,6 +2,7 @@ using Ryujinx.Common; using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.Horizon.Common; using System.Collections.Generic; +using System.Threading; namespace Ryujinx.HLE.HOS.Kernel.Common { @@ -14,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Common private readonly long[] _current2; private readonly long[] _peak; - private readonly object _lock; + private readonly object _lock = new(); private readonly LinkedList _waitingThreads; @@ -27,8 +28,6 @@ namespace Ryujinx.HLE.HOS.Kernel.Common _current2 = new long[(int)LimitableResource.Count]; _peak = new long[(int)LimitableResource.Count]; - _lock = new object(); - _waitingThreads = new LinkedList(); } diff --git a/src/Ryujinx.HLE/HOS/Kernel/Memory/KCodeMemory.cs b/src/Ryujinx.HLE/HOS/Kernel/Memory/KCodeMemory.cs index c725501b0..e6d96d803 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Memory/KCodeMemory.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Memory/KCodeMemory.cs @@ -4,6 +4,7 @@ using Ryujinx.HLE.HOS.Kernel.Process; using Ryujinx.Horizon.Common; using System; using System.Diagnostics; +using System.Threading; namespace Ryujinx.HLE.HOS.Kernel.Memory { @@ -11,7 +12,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory { public KProcess Owner { get; private set; } private readonly KPageList _pageList; - private readonly object _lock; + private readonly Lock _lock = new(); private ulong _address; private bool _isOwnerMapped; private bool _isMapped; @@ -19,7 +20,6 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory public KCodeMemory(KernelContext context) : base(context) { _pageList = new KPageList(); - _lock = new object(); } public Result Initialize(ulong address, ulong size) diff --git a/src/Ryujinx.HLE/HOS/Kernel/Threading/KCriticalSection.cs b/src/Ryujinx.HLE/HOS/Kernel/Threading/KCriticalSection.cs index 3d6744882..bfa6b68f6 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Threading/KCriticalSection.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Threading/KCriticalSection.cs @@ -5,7 +5,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading class KCriticalSection { private readonly KernelContext _context; - private readonly object _lock; + private readonly object _lock = new(); private int _recursionCount; public object Lock => _lock; @@ -13,7 +13,6 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading public KCriticalSection(KernelContext context) { _context = context; - _lock = new object(); } public void Enter() diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/Types/NodeLatestUpdate.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/Types/NodeLatestUpdate.cs index 0461e783e..826a50458 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/Types/NodeLatestUpdate.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/Types/NodeLatestUpdate.cs @@ -1,5 +1,6 @@ using Ryujinx.Common.Memory; using System.Runtime.InteropServices; +using System.Threading; namespace Ryujinx.HLE.HOS.Services.Ldn.Types { @@ -12,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.Types static class NodeLatestUpdateHelper { - private static readonly object _lock = new(); + private static readonly Lock _lock = new(); public static void CalculateLatestUpdate(this Array8 array, Array8 beforeNodes, Array8 afterNodes) { diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/LanDiscovery.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/LanDiscovery.cs index b5f643d23..8b7af42a0 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/LanDiscovery.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/LanDiscovery.cs @@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm private ILdnTcpSocket _tcp; private LdnProxyUdpServer _udp, _udp2; private readonly List _stations = new(); - private readonly object _lock = new(); + private readonly Lock _lock = new(); private readonly AutoResetEvent _apConnected = new(false); diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/NetworkTimeout.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/NetworkTimeout.cs index 5012d5d81..f7a9d77a4 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/NetworkTimeout.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/NetworkTimeout.cs @@ -10,7 +10,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu private readonly Action _timeoutCallback; private CancellationTokenSource _cancel; - private readonly object _lock = new object(); + private readonly Lock _lock = new(); public NetworkTimeout(int idleTimeout, Action timeoutCallback) { diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/EphemeralPortPool.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/EphemeralPortPool.cs index bc3a5edf2..9ea56d050 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/EphemeralPortPool.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/EphemeralPortPool.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Threading; namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy { @@ -8,7 +9,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy private readonly List _ephemeralPorts = new List(); - private readonly object _lock = new object(); + private readonly Lock _lock = new(); public ushort Get() { diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs index 7ecd6835d..9d5bb8d01 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Numerics; +using System.Threading; namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd { @@ -10,7 +11,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd { private static readonly ConcurrentDictionary _registry = new(); - private readonly object _lock = new(); + private readonly Lock _lock = new(); private readonly List _fds; diff --git a/src/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs b/src/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs index 49becac55..622b62c16 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs @@ -16,6 +16,7 @@ using System.Collections.Generic; using System.IO; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Threading; namespace Ryujinx.HLE.HOS.Services.Ssl { @@ -43,7 +44,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl private bool _initialized; private Dictionary _certificates; - private readonly object _lock = new(); + private readonly Lock _lock = new(); private struct CertStoreFileHeader { diff --git a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/HOSBinderDriverServer.cs b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/HOSBinderDriverServer.cs index bc7bffcb6..5151930a5 100644 --- a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/HOSBinderDriverServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/HOSBinderDriverServer.cs @@ -2,6 +2,7 @@ using Ryujinx.Common.Logging; using Ryujinx.HLE.HOS.Kernel.Threading; using System; using System.Collections.Generic; +using System.Threading; namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger { @@ -11,7 +12,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger private static int _lastBinderId = 0; - private static readonly object _lock = new(); + private static readonly Lock _lock = new(); public static int RegisterBinderObject(IBinder binder) { diff --git a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs index 601e85867..23bf8bcfc 100644 --- a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs +++ b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs @@ -37,7 +37,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger private int _swapInterval; private int _swapIntervalDelay; - private readonly object _lock = new(); + private readonly Lock _lock = new(); public long RenderLayerId { get; private set; } diff --git a/src/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneManager.cs b/src/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneManager.cs index 3b57b1805..155733d2e 100644 --- a/src/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneManager.cs @@ -2,6 +2,7 @@ using Ryujinx.Common.Memory; using Ryujinx.HLE.HOS.Services.Time.Clock; using System; using System.IO; +using System.Threading; namespace Ryujinx.HLE.HOS.Services.Time.TimeZone { @@ -13,7 +14,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone private UInt128 _timeZoneRuleVersion; private uint _totalLocationNameCount; private SteadyClockTimePoint _timeZoneUpdateTimePoint; - private readonly object _lock = new(); + private readonly Lock _lock = new(); public TimeZoneManager() { diff --git a/src/Ryujinx.HLE/Ryujinx.HLE.csproj b/src/Ryujinx.HLE/Ryujinx.HLE.csproj index 83e7b8810..d42ecf8b8 100644 --- a/src/Ryujinx.HLE/Ryujinx.HLE.csproj +++ b/src/Ryujinx.HLE/Ryujinx.HLE.csproj @@ -1,7 +1,6 @@ - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Headless.SDL2/Ryujinx.Headless.SDL2.csproj b/src/Ryujinx.Headless.SDL2/Ryujinx.Headless.SDL2.csproj index 8fbf9be1e..fe535e6d5 100644 --- a/src/Ryujinx.Headless.SDL2/Ryujinx.Headless.SDL2.csproj +++ b/src/Ryujinx.Headless.SDL2/Ryujinx.Headless.SDL2.csproj @@ -1,7 +1,6 @@ - net8.0 win-x64;osx-x64;linux-x64 Exe true diff --git a/src/Ryujinx.Horizon.Common/Ryujinx.Horizon.Common.csproj b/src/Ryujinx.Horizon.Common/Ryujinx.Horizon.Common.csproj index 00e0b1af9..b1caf6780 100644 --- a/src/Ryujinx.Horizon.Common/Ryujinx.Horizon.Common.csproj +++ b/src/Ryujinx.Horizon.Common/Ryujinx.Horizon.Common.csproj @@ -1,7 +1,6 @@ - net8.0 $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Horizon/Ryujinx.Horizon.csproj b/src/Ryujinx.Horizon/Ryujinx.Horizon.csproj index 18c639d67..727513484 100644 --- a/src/Ryujinx.Horizon/Ryujinx.Horizon.csproj +++ b/src/Ryujinx.Horizon/Ryujinx.Horizon.csproj @@ -1,7 +1,6 @@ - net8.0 $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Horizon/Sdk/Friends/Detail/Ipc/NotificationService.cs b/src/Ryujinx.Horizon/Sdk/Friends/Detail/Ipc/NotificationService.cs index 534bf63ed..585b40df3 100644 --- a/src/Ryujinx.Horizon/Sdk/Friends/Detail/Ipc/NotificationService.cs +++ b/src/Ryujinx.Horizon/Sdk/Friends/Detail/Ipc/NotificationService.cs @@ -4,6 +4,7 @@ using Ryujinx.Horizon.Sdk.OsTypes; using Ryujinx.Horizon.Sdk.Sf; using System; using System.Collections.Generic; +using System.Threading; namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc { @@ -13,7 +14,7 @@ namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc private readonly Uid _userId; private readonly FriendsServicePermissionLevel _permissionLevel; - private readonly object _lock = new(); + private readonly Lock _lock = new(); private SystemEventType _notificationEvent; diff --git a/src/Ryujinx.Horizon/Sdk/Ngc/Detail/ContentsReader.cs b/src/Ryujinx.Horizon/Sdk/Ngc/Detail/ContentsReader.cs index 6a0fc4f9e..d3ed37e78 100644 --- a/src/Ryujinx.Horizon/Sdk/Ngc/Detail/ContentsReader.cs +++ b/src/Ryujinx.Horizon/Sdk/Ngc/Detail/ContentsReader.cs @@ -3,6 +3,7 @@ using Ryujinx.Horizon.Sdk.Fs; using System; using System.IO; using System.IO.Compression; +using System.Threading; namespace Ryujinx.Horizon.Sdk.Ngc.Detail { @@ -22,13 +23,12 @@ namespace Ryujinx.Horizon.Sdk.Ngc.Detail } private readonly IFsClient _fsClient; - private readonly object _lock; + private readonly Lock _lock = new(); private bool _intialized; private ulong _cacheSize; public ContentsReader(IFsClient fsClient) { - _lock = new(); _fsClient = fsClient; } diff --git a/src/Ryujinx.Horizon/Sdk/OsTypes/Impl/MultiWaitImpl.cs b/src/Ryujinx.Horizon/Sdk/OsTypes/Impl/MultiWaitImpl.cs index 406352003..879a3a58f 100644 --- a/src/Ryujinx.Horizon/Sdk/OsTypes/Impl/MultiWaitImpl.cs +++ b/src/Ryujinx.Horizon/Sdk/OsTypes/Impl/MultiWaitImpl.cs @@ -2,6 +2,7 @@ using Ryujinx.Common; using Ryujinx.Horizon.Common; using System; using System.Collections.Generic; +using System.Threading; namespace Ryujinx.Horizon.Sdk.OsTypes.Impl { @@ -13,7 +14,7 @@ namespace Ryujinx.Horizon.Sdk.OsTypes.Impl private readonly List _multiWaits; - private readonly object _lock = new(); + private readonly Lock _lock = new(); private int _waitingThreadHandle; diff --git a/src/Ryujinx.Input.SDL2/Ryujinx.Input.SDL2.csproj b/src/Ryujinx.Input.SDL2/Ryujinx.Input.SDL2.csproj index 3d880d5fa..89f5adda1 100644 --- a/src/Ryujinx.Input.SDL2/Ryujinx.Input.SDL2.csproj +++ b/src/Ryujinx.Input.SDL2/Ryujinx.Input.SDL2.csproj @@ -1,7 +1,6 @@  - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs b/src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs index fd34fe219..c580e4e7d 100644 --- a/src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs +++ b/src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs @@ -1,6 +1,7 @@ using Ryujinx.SDL2.Common; using System; using System.Collections.Generic; +using System.Threading; using static SDL2.SDL; namespace Ryujinx.Input.SDL2 @@ -9,7 +10,7 @@ namespace Ryujinx.Input.SDL2 { private readonly Dictionary _gamepadsInstanceIdsMapping; private readonly List _gamepadsIds; - private readonly object _lock = new(); + private readonly Lock _lock = new(); public ReadOnlySpan GamepadsIds { diff --git a/src/Ryujinx.Input/HLE/NpadManager.cs b/src/Ryujinx.Input/HLE/NpadManager.cs index 1dc87358d..a77aa2168 100644 --- a/src/Ryujinx.Input/HLE/NpadManager.cs +++ b/src/Ryujinx.Input/HLE/NpadManager.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Runtime.CompilerServices; +using System.Threading; using CemuHookClient = Ryujinx.Input.Motion.CemuHook.Client; using ControllerType = Ryujinx.Common.Configuration.Hid.ControllerType; using PlayerIndex = Ryujinx.HLE.HOS.Services.Hid.PlayerIndex; @@ -18,7 +19,7 @@ namespace Ryujinx.Input.HLE { private readonly CemuHookClient _cemuHookClient; - private readonly object _lock = new(); + private readonly Lock _lock = new(); private bool _blockInputUpdates; diff --git a/src/Ryujinx.Input/Ryujinx.Input.csproj b/src/Ryujinx.Input/Ryujinx.Input.csproj index 0974b707a..6741a2b3e 100644 --- a/src/Ryujinx.Input/Ryujinx.Input.csproj +++ b/src/Ryujinx.Input/Ryujinx.Input.csproj @@ -1,7 +1,6 @@ - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Memory/Ryujinx.Memory.csproj b/src/Ryujinx.Memory/Ryujinx.Memory.csproj index 17745dd61..eda3ed17f 100644 --- a/src/Ryujinx.Memory/Ryujinx.Memory.csproj +++ b/src/Ryujinx.Memory/Ryujinx.Memory.csproj @@ -1,7 +1,6 @@  - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.SDL2.Common/Ryujinx.SDL2.Common.csproj b/src/Ryujinx.SDL2.Common/Ryujinx.SDL2.Common.csproj index 0811ad850..895d1a9ce 100644 --- a/src/Ryujinx.SDL2.Common/Ryujinx.SDL2.Common.csproj +++ b/src/Ryujinx.SDL2.Common/Ryujinx.SDL2.Common.csproj @@ -1,7 +1,6 @@ - net8.0 $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.SDL2.Common/SDL2Driver.cs b/src/Ryujinx.SDL2.Common/SDL2Driver.cs index 4d8961335..851c07867 100644 --- a/src/Ryujinx.SDL2.Common/SDL2Driver.cs +++ b/src/Ryujinx.SDL2.Common/SDL2Driver.cs @@ -36,7 +36,7 @@ namespace Ryujinx.SDL2.Common private ConcurrentDictionary> _registeredWindowHandlers; - private readonly object _lock = new(); + private readonly Lock _lock = new(); private SDL2Driver() { } diff --git a/src/Ryujinx.ShaderTools/Ryujinx.ShaderTools.csproj b/src/Ryujinx.ShaderTools/Ryujinx.ShaderTools.csproj index 639ceeac2..08d587f9c 100644 --- a/src/Ryujinx.ShaderTools/Ryujinx.ShaderTools.csproj +++ b/src/Ryujinx.ShaderTools/Ryujinx.ShaderTools.csproj @@ -1,7 +1,6 @@ - net8.0 Exe Debug;Release $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Tests.Memory/Ryujinx.Tests.Memory.csproj b/src/Ryujinx.Tests.Memory/Ryujinx.Tests.Memory.csproj index 3bb4bf74d..e5ebca789 100644 --- a/src/Ryujinx.Tests.Memory/Ryujinx.Tests.Memory.csproj +++ b/src/Ryujinx.Tests.Memory/Ryujinx.Tests.Memory.csproj @@ -1,7 +1,6 @@ - net8.0 false $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Tests.Unicorn/Ryujinx.Tests.Unicorn.csproj b/src/Ryujinx.Tests.Unicorn/Ryujinx.Tests.Unicorn.csproj index 2f7695356..f9f42416f 100644 --- a/src/Ryujinx.Tests.Unicorn/Ryujinx.Tests.Unicorn.csproj +++ b/src/Ryujinx.Tests.Unicorn/Ryujinx.Tests.Unicorn.csproj @@ -1,7 +1,6 @@ - net8.0 true Debug;Release $(DefaultItemExcludes);._* diff --git a/src/Ryujinx.Tests/Ryujinx.Tests.csproj b/src/Ryujinx.Tests/Ryujinx.Tests.csproj index 0480c206e..daa2b4287 100644 --- a/src/Ryujinx.Tests/Ryujinx.Tests.csproj +++ b/src/Ryujinx.Tests/Ryujinx.Tests.csproj @@ -1,7 +1,6 @@ - net8.0 Exe false diff --git a/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj b/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj index 7f57c7bf5..130ea9a50 100644 --- a/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj +++ b/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj @@ -1,7 +1,6 @@ - net8.0 true $(DefaultItemExcludes);._* diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs index 5789737d6..8f661f969 100644 --- a/src/Ryujinx/AppHost.cs +++ b/src/Ryujinx/AppHost.cs @@ -122,7 +122,7 @@ namespace Ryujinx.Ava private bool _dialogShown; private readonly bool _isFirmwareTitle; - private readonly object _lockObject = new(); + private readonly Lock _lockObject = new(); public event EventHandler AppExit; public event EventHandler StatusUpdatedEvent; @@ -680,13 +680,13 @@ namespace Ryujinx.Ava if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime) { if (!SetupValidator.CanStartApplication(ContentManager, ApplicationPath, out UserError userError)) - { + { if (SetupValidator.CanFixStartApplication(ContentManager, ApplicationPath, userError, out firmwareVersion)) { if (userError is UserError.NoFirmware) { UserResult result = await ContentDialogHelper.CreateConfirmationDialog( - LocaleManager.Instance[LocaleKeys.DialogFirmwareNoFirmwareInstalledMessage], + LocaleManager.Instance[LocaleKeys.DialogFirmwareNoFirmwareInstalledMessage], LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogFirmwareInstallEmbeddedMessage, firmwareVersion.VersionString), LocaleManager.Instance[LocaleKeys.InputDialogYes], LocaleManager.Instance[LocaleKeys.InputDialogNo], diff --git a/src/Ryujinx/Ryujinx.csproj b/src/Ryujinx/Ryujinx.csproj index 989a3a5bd..e5f6636c3 100644 --- a/src/Ryujinx/Ryujinx.csproj +++ b/src/Ryujinx/Ryujinx.csproj @@ -1,6 +1,5 @@ - net8.0 win-x64;osx-x64;linux-x64 Exe true diff --git a/src/Spv.Generator/Spv.Generator.csproj b/src/Spv.Generator/Spv.Generator.csproj index 5dec0b64e..3642709d8 100644 --- a/src/Spv.Generator/Spv.Generator.csproj +++ b/src/Spv.Generator/Spv.Generator.csproj @@ -1,7 +1,6 @@  - net8.0 $(DefaultItemExcludes);._*