mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-23 14:10:40 +02:00
made folder sync lock protected
This commit is contained in:
parent
c233f2190c
commit
3037c18e31
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue