using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace GreenTree.Nachtragsmanagement.Core.ComponentModel
{
///
/// Provides a convenience methodology for implementing locked access to resources.
///
///
/// Intended as an infrastructure class.
///
public class WriteLockDisposable : IDisposable
{
private readonly ReaderWriterLockSlim _rwLock;
///
/// Initializes a new instance of the class.
///
/// The rw lock.
public WriteLockDisposable(ReaderWriterLockSlim rwLock)
{
_rwLock = rwLock;
_rwLock.EnterWriteLock();
}
void IDisposable.Dispose()
{
_rwLock.ExitWriteLock();
}
}
}