mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
move to new System.Threading.Lock type for better performance
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user