title: Does Monitor.TryEnter and lock() work together?
body: <p>I am looking at code that has been created and it uses a TryEnter in one method call and lock in others. So, like this:</p>
  
  <pre><code>private readonly object xmppLock = new object();
  
  void f1() 
  {
      if (Monitor.TryEnter(xmppLock))
      {
          try
          {
              // Do stuff
          }
          finally
          {
              Monitor.Exit(xmppLock);
          }
      }
  }
  
  void f2()
  {
      lock(xmppLock)
      {
          // Do stuff
      }
  }
  </code></pre>
  
  <p>Is this okay?</p>