title: C# Monitor behavior in case user quits application
body: <p>I am using the following code for a critical section of a web page</p>
  
  <pre><code>if(Monitor.TryEnter(lockObj,60000))
  {
    try{
         //write some things to a file
       }
    finally
    {
      Monitor.Exit(lockObj);
    }
  }
  </code></pre>
  
  <p>Here, lockObj is a static member of the class. My question is, what happens if the user closes the web page or the browser while the critical section is being executed? Does lockObj remain locked for future page requests?</p>