title: ReaderWriterLock that allows starvation
body: <p>The following code does not complete, because second reader (tRead2) cannot acquire lock.</p>
  
  <pre><code>ReaderWriterLockSlim rw = new ReaderWriterLockSlim();
  
  var tRead1 = Task.Run
      (
          () =&gt; rw.EnterReadLock()
      );
  
  var tWrite = Task.Run
      (
            () =&gt;
            {
                Thread.Sleep(1000);
                rw.EnterWriteLock();
            }
      );
  
  
  var tRead2 = Task.Run
      (
          () =&gt;
          {
  
              Thread.Sleep(3000);
              rw.EnterReadLock();
          }
      );
  
  Task.WaitAll(tRead1, tRead2);
  </code></pre>
  
  <p>I didn't expect this situation, I thought that since writer (tWrite) cannot get the lock, then the tRead2 would be allowed to do that (and tWrite will wait till all read-mode locks are released). I interpret this unexpected behavior as a way to disallow starvation of writer.</p>
  
  <p>Is there any synchronization structure that would allow tRead2 to get the lock (even if tWrite might be starved)?</p>