made folder sync lock protected

This commit is contained in:
Luke Pulverenti 2013-09-19 15:35:53 -04:00
parent c233f2190c
commit 3037c18e31

View file

@ -134,7 +134,7 @@ namespace MediaBrowser.Controller.Entities
{ {
List<BaseItem> newChildren; List<BaseItem> newChildren;
lock (_childrenSyncLock) lock (ChildrenSyncLock)
{ {
newChildren = _children.ToList(); newChildren = _children.ToList();
@ -477,7 +477,7 @@ namespace MediaBrowser.Controller.Entities
/// <summary> /// <summary>
/// The _children sync lock /// The _children sync lock
/// </summary> /// </summary>
private object _childrenSyncLock = new object(); protected object ChildrenSyncLock = new object();
/// <summary> /// <summary>
/// Gets or sets the actual children. /// Gets or sets the actual children.
/// </summary> /// </summary>
@ -486,7 +486,7 @@ namespace MediaBrowser.Controller.Entities
{ {
get get
{ {
LazyInitializer.EnsureInitialized(ref _children, ref _childrenInitialized, ref _childrenSyncLock, LoadChildrenInternal); LazyInitializer.EnsureInitialized(ref _children, ref _childrenInitialized, ref ChildrenSyncLock, LoadChildrenInternal);
return _children; return _children;
} }
} }
@ -711,7 +711,7 @@ namespace MediaBrowser.Controller.Entities
if (actualRemovals.Count > 0) if (actualRemovals.Count > 0)
{ {
lock (_childrenSyncLock) lock (ChildrenSyncLock)
{ {
_children = new ConcurrentBag<BaseItem>(_children.Except(actualRemovals)); _children = new ConcurrentBag<BaseItem>(_children.Except(actualRemovals));
} }