mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
update locking
This commit is contained in:
parent
c2f6e5fefc
commit
fb91b7c808
@ -233,7 +233,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks
|
||||
/// <summary>
|
||||
/// The _triggers
|
||||
/// </summary>
|
||||
private IEnumerable<ITaskTrigger> _triggers;
|
||||
private volatile List<ITaskTrigger> _triggers;
|
||||
/// <summary>
|
||||
/// The _triggers sync lock
|
||||
/// </summary>
|
||||
@ -532,7 +532,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks
|
||||
/// Loads the triggers.
|
||||
/// </summary>
|
||||
/// <returns>IEnumerable{BaseTaskTrigger}.</returns>
|
||||
private IEnumerable<ITaskTrigger> LoadTriggers()
|
||||
private List<ITaskTrigger> LoadTriggers()
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -543,12 +543,12 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
// File doesn't exist. No biggie. Return defaults.
|
||||
return ScheduledTask.GetDefaultTriggers();
|
||||
return ScheduledTask.GetDefaultTriggers().ToList();
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
// File doesn't exist. No biggie. Return defaults.
|
||||
return ScheduledTask.GetDefaultTriggers();
|
||||
return ScheduledTask.GetDefaultTriggers().ToList();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <value>The last activity date.</value>
|
||||
public DateTime? LastActivityDate { get; set; }
|
||||
|
||||
private UserConfiguration _config;
|
||||
private volatile UserConfiguration _config;
|
||||
private readonly object _configSyncLock = new object();
|
||||
[IgnoreDataMember]
|
||||
public UserConfiguration Configuration
|
||||
@ -151,7 +151,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
set { _config = value; }
|
||||
}
|
||||
|
||||
private UserPolicy _policy;
|
||||
private volatile UserPolicy _policy;
|
||||
private readonly object _policySyncLock = new object();
|
||||
[IgnoreDataMember]
|
||||
public UserPolicy Policy
|
||||
|
@ -226,7 +226,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
/// <summary>
|
||||
/// The _root folder
|
||||
/// </summary>
|
||||
private AggregateFolder _rootFolder;
|
||||
private volatile AggregateFolder _rootFolder;
|
||||
/// <summary>
|
||||
/// The _root folder sync lock
|
||||
/// </summary>
|
||||
@ -759,7 +759,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
return rootFolder;
|
||||
}
|
||||
|
||||
private UserRootFolder _userRootFolder;
|
||||
private volatile UserRootFolder _userRootFolder;
|
||||
private readonly object _syncLock = new object();
|
||||
public Folder GetUserRootFolder()
|
||||
{
|
||||
|
@ -239,7 +239,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
|
||||
public Task CancelSeriesTimerAsync(string timerId, CancellationToken cancellationToken)
|
||||
{
|
||||
var timers = _timerProvider.GetAll().Where(i => string.Equals(i.SeriesTimerId, timerId, StringComparison.OrdinalIgnoreCase));
|
||||
var timers = _timerProvider
|
||||
.GetAll()
|
||||
.Where(i => string.Equals(i.SeriesTimerId, timerId, StringComparison.OrdinalIgnoreCase))
|
||||
.ToList();
|
||||
|
||||
foreach (var timer in timers)
|
||||
{
|
||||
CancelTimerInternal(timer.Id);
|
||||
|
@ -13,7 +13,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
where T : class
|
||||
{
|
||||
private readonly object _fileDataLock = new object();
|
||||
private List<T> _items;
|
||||
private volatile List<T> _items;
|
||||
private readonly IJsonSerializer _jsonSerializer;
|
||||
protected readonly ILogger Logger;
|
||||
private readonly string _dataPath;
|
||||
|
Loading…
Reference in New Issue
Block a user