#62 - File locking problem in cache

This commit is contained in:
Luke Pulverenti
2013-04-02 22:59:27 -04:00
parent 713afcf675
commit fa884f3fea
16 changed files with 239 additions and 294 deletions

View File

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