update locking

This commit is contained in:
Luke Pulverenti
2016-01-31 19:57:40 -05:00
parent c2f6e5fefc
commit fb91b7c808
5 changed files with 14 additions and 10 deletions

View File

@@ -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()
{

View File

@@ -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);

View File

@@ -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;