mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-19 15:33:03 +03:00
#62 - File locking problem in cache
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Common.IO
|
||||
{
|
||||
@@ -18,11 +17,6 @@ namespace MediaBrowser.Common.IO
|
||||
/// </summary>
|
||||
private readonly ConcurrentDictionary<string, string> _subFolderPaths = new ConcurrentDictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// The _file locks
|
||||
/// </summary>
|
||||
private readonly NamedLock _fileLocks = new NamedLock();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path.
|
||||
/// </summary>
|
||||
@@ -170,24 +164,6 @@ namespace MediaBrowser.Common.IO
|
||||
return File.Exists(path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Waits for lock.
|
||||
/// </summary>
|
||||
/// <param name="resourcePath">The resource path.</param>
|
||||
public Task WaitForLockAsync(string resourcePath)
|
||||
{
|
||||
return _fileLocks.WaitAsync(resourcePath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Releases the lock.
|
||||
/// </summary>
|
||||
/// <param name="resourcePath">The resource path.</param>
|
||||
public void ReleaseLock(string resourcePath)
|
||||
{
|
||||
_fileLocks.Release(resourcePath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
||||
/// </summary>
|
||||
@@ -204,7 +180,6 @@ namespace MediaBrowser.Common.IO
|
||||
{
|
||||
if (dispose)
|
||||
{
|
||||
_fileLocks.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user