Implementation of ordered lock pattern
I haven't extensively tested it, but there are a few things I've noted:


The class has two members which hold on to IDisposable resources. Therefore, the class must implement IDisposable as well and Dispose() of those members.
Many of the class members are assigned at construction time only. Mark them as readonly to signify intent and to potentially allow the runtime to perform some optimizations.
Current naming conventions favor camelCasing over Hungarian Notation for class members.
+= 1 and -= 1 can be simplified to ++ and --, respectively.
ApplicationException has been out of favor for quite a long time.
Identify your class members with the this keyword.
Forgot to put this bullet point in on the first cut: replace .Count() &gt; 0 with .Any(). This is idiomatic to what you want, rather than how to do it. In other words, the implementation of the former could very well iterate over the entire collection to get the count, while the latter may just check for the existence of one in its collection.
Another omission: I replaced the declaration of HashSet&lt;int&gt; with ISet&lt;int&gt; since coding to interfaces allows for more flexibility in changing implementations later on.


All that being said, here's a first-cut rework:

public class OrderedLock : IDisposable
{
    private static readonly ConcurrentDictionary&lt;int, object&gt; createdLocks = new ConcurrentDictionary&lt;int, object&gt;();
    [ThreadStatic]
    private static ISet&lt;int&gt; acquiredLocks;

    private readonly ThreadLocal&lt;int&gt; refCount = new ThreadLocal&lt;int&gt;(false);
    private readonly ReaderWriterLockSlim locker = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
    private readonly int id;

    /// &lt;exception cref="InvalidOperationException"&gt;Duplicate identifier detected&lt;/exception&gt;
    public OrderedLock(int id)
    {
        if (!createdLocks.TryAdd(id, null))
        {
            throw new InvalidOperationException("Duplicate identifier detected");
        }

        this.id = id;
        this.refCount.Value = 0;
    }

    public void AcquireReadLock()
    {
        this.CheckLockOrder();
        this.locker.EnterReadLock();
    }

    public void AcquireWriteLock()
    {
        this.CheckLockOrder();
        this.locker.EnterWriteLock();
    }

    public void ReleaseReadLock()
    {
        this.refCount.Value--;
        this.locker.ExitReadLock();
        if (this.refCount.Value == 0)
        {
            acquiredLocks.Remove(this.id);
        }
    }

    public void ReleaseWriteLock()
    {
        this.refCount.Value--;
        this.locker.ExitWriteLock();
        if (this.refCount.Value == 0)
        {
            acquiredLocks.Remove(this.id);
        }
    }

    public void Dispose()
    {
        while (this.locker.IsWriteLockHeld)
        {
            this.ReleaseWriteLock();
        }

        while (this.locker.IsReadLockHeld)
        {
            ReleaseReadLock();
        }

        this.locker.Dispose();
        this.refCount.Dispose();
        GC.SuppressFinalize(this);
    }

    /// &lt;exception cref="InvalidOperationException"&gt;Invalid order of locking detected&lt;/exception&gt;
    private void CheckLockOrder()
    {
        if (acquiredLocks == null)
        {
            acquiredLocks = new HashSet&lt;int&gt;();
        }

        if (!acquiredLocks.Contains(this.id))
        {
            if (acquiredLocks.Any() &amp;&amp; acquiredLocks.Max() &gt; this.id)
            {
                throw new InvalidOperationException("Invalid order of locking detected");
            }

            acquiredLocks.Add(this.id);
        }

        this.refCount.Value++;
    }
}