title: Deadlock when locking manualResetEvent
body: <p>I encounter a deadlock caused when locking instance of manualResetEvent. I can't figure out how to solve it. I will appreciate any help.</p>
  
  <p>I have 2 methods in a class performed by different threads:</p>
  
  <pre><code>private ManualResetEvent _event = new ManualResetEvent (true);
  
  private void process(){
    ...
    lock(_event){
      _event.WaitOne();
      ...
    }
  }
  
  internal void Stop(){
    _event.Reset();
    lock(_event){
      ...
    }
  }
  </code></pre>
  
  <p>The first thread acuired the lock and is blocked in _event.WaitOne();</p>
  
  <p>The socond thread performed the line  _event.Reset(); and is blocked when trying to perform lock(_event). </p>
  
  <p>I thought that when thread 1 is blocked on WaitOne, the lock should be released. I guess I'm wrong. I don't know how can I fix it. 
  b.t.w - I added the lock since the code in the lock block should be synchronized in both threads.</p>
  
  <p>Thanks again and sorry for the long post.</p>