diff options
| author | Bond-009 <bond.009@outlook.com> | 2024-12-20 22:15:45 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-20 22:15:45 +0100 |
| commit | c4d44198007be4cfd48fcf5ff4d06d9b8f0cb75c (patch) | |
| tree | b6bdace3074343726bd70f8a5151480c8d87fe09 /src | |
| parent | 17f064314749359d159b06409d46918e7cd47e10 (diff) | |
| parent | 2614fecf8df6e04b0d0a2b33722923c239ed0f91 (diff) | |
Merge pull request #13213 from Ich1goSan/master
move to new System.Threading.Lock type for better performance
Diffstat (limited to 'src')
| -rw-r--r-- | src/Jellyfin.LiveTv/Timers/ItemDataProvider.cs | 3 | ||||
| -rw-r--r-- | src/Jellyfin.Networking/Manager/NetworkManager.cs | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/Jellyfin.LiveTv/Timers/ItemDataProvider.cs b/src/Jellyfin.LiveTv/Timers/ItemDataProvider.cs index 9e7323f5b..6a68b8c25 100644 --- a/src/Jellyfin.LiveTv/Timers/ItemDataProvider.cs +++ b/src/Jellyfin.LiveTv/Timers/ItemDataProvider.cs @@ -6,6 +6,7 @@ using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Text.Json; +using System.Threading; using Jellyfin.Extensions.Json; using Microsoft.Extensions.Logging; @@ -15,7 +16,7 @@ namespace Jellyfin.LiveTv.Timers where T : class { private readonly string _dataPath; - private readonly object _fileDataLock = new object(); + private readonly Lock _fileDataLock = new(); private readonly JsonSerializerOptions _jsonOptions = JsonDefaults.Options; private T[]? _items; diff --git a/src/Jellyfin.Networking/Manager/NetworkManager.cs b/src/Jellyfin.Networking/Manager/NetworkManager.cs index 10aed673b..b1fc5d406 100644 --- a/src/Jellyfin.Networking/Manager/NetworkManager.cs +++ b/src/Jellyfin.Networking/Manager/NetworkManager.cs @@ -27,7 +27,7 @@ public class NetworkManager : INetworkManager, IDisposable /// <summary> /// Threading lock for network properties. /// </summary> - private readonly object _initLock; + private readonly Lock _initLock; private readonly ILogger<NetworkManager> _logger; @@ -35,7 +35,7 @@ public class NetworkManager : INetworkManager, IDisposable private readonly IConfiguration _startupConfig; - private readonly object _networkEventLock; + private readonly Lock _networkEventLock; /// <summary> /// Holds the published server URLs and the IPs to use them on. @@ -93,7 +93,7 @@ public class NetworkManager : INetworkManager, IDisposable _interfaces = new List<IPData>(); _macAddresses = new List<PhysicalAddress>(); _publishedServerUrls = new List<PublishedServerUriOverride>(); - _networkEventLock = new object(); + _networkEventLock = new(); _remoteAddressFilter = new List<IPNetwork>(); _ = bool.TryParse(startupConfig[DetectNetworkChangeKey], out var detectNetworkChange); |
