title: Is it completely safe to use pattern of ReaderWriterLockSlim.EnterXXX() with consequent try-finally clause
body: <p><a href="http://msdn.microsoft.com/en-us/library/system.threading.readerwriterlockslim.aspx" rel="noreferrer">MSDN Documentation</a> and many examples of using <code>ReaderWriterLockSlim</code> class recommends using the following pattern:</p>
  
  <pre><code>cacheLock.EnterWriteLock();
  try
  {
      //Do something
  }
  finally
  {
      cacheLock.ExitWriteLock();
  }
  </code></pre>
  
  <p>But I'm curious if it's completely safe. Is it possible that some exception will happen after lock is acquired, but before the <code>try</code> statement so that lock is stuck in the locked state? The most obvious candidate is <code>ThreadAbortException</code>. I understand that probability of this situation is extreemely small, but the consequences are extreemely bad - so I think it worth thinking about it. I don't believe compiler understands this pattern and prevents processor from interrupting thread before <code>try</code> statement.</p>
  
  <p>If there is theoretical possibility that this code is unsafe, and is there ways to make it safer?</p>