refactor routing

This commit is contained in:
sgay
2012-07-22 14:01:18 -02:00
parent 533cc91a68
commit 3546b3e954
30 changed files with 408 additions and 251 deletions

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace Umbraco.Core
{
/// <summary>
/// Provides a convenience methodology for implementing locked access to resources.
/// </summary>
/// <remarks>
/// Intended as an infrastructure class.
/// </remarks>
public class ReadLock : IDisposable
{
private readonly ReaderWriterLockSlim _rwLock;
/// <summary>
/// Initializes a new instance of the <see cref="ReadLock"/> class.
/// </summary>
/// <ReadLock name="rwLock">The rw lock.</param>
public ReadLock(ReaderWriterLockSlim rwLock)
{
_rwLock = rwLock;
_rwLock.EnterReadLock();
}
void IDisposable.Dispose()
{
_rwLock.ExitReadLock();
}
}
}