title: ReaderWriterLockSlim does not solve mutliple threads writing to the file
body: <p>when I run method DoStuff() from below class I sometimes get an exception:</p>
  
  <pre><code>The process cannot access the file because it is being used by another process.
  </code></pre>
  
  <p>Why can it occur? I think that ReaderWriterLockSlim should solve that potential problem? </p>
  
  <pre><code>public class Test
  {
      private ReaderWriterLockSlim lock_ = new ReaderWriterLockSlim();
      public Test()
      {
  
      }
  
      public void DoStuff()
      {
          while (true)
          {
              Task[] tasks = new Task[5];
              for (int i = 0; i &lt; 5; i++)
              {
                  tasks[i] = Task.Factory.StartNew(() =&gt;
                  {
                          lock_.EnterReadLock();
                          try
                          {
                              File.AppendAllText("test.txt", "test");
                          }
                          finally
                          {
                              lock_.ExitReadLock();
                          }
                      }
                  });
              }
              Task.WaitAll(tasks);
              Thread.Sleep(5000);
          }
      }
  }
  </code></pre>