﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

using Hydra.Framework;
using Hydra.Framework.Helpers;

namespace Hydra.Framework.Threading
{
    /// <summary>
    /// Writer Lock support
    /// with the option of downgrading to read locks if required.
    /// </summary>
    public class WriterLock
        : LockHelper
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="WriterLock"/> class.
        /// </summary>
        /// <param name="rwLock">The rw lock.</param>
        /// <param name="timeout">The timeout.</param>
        public WriterLock(ReaderWriterLock rwLock, TimeSpan timeout)
            : base(rwLock, AccessType.Write, timeout)
        {
        }
    }
}
