title: use the same lock object at two different code block?
body: <p>Can I use the same lock object at two methods, accessed by two different threads? Goal is to make task1 and task2 thread safe.</p>
  
  <pre><code>object lockObject = new object();
  
  // Thread 1
  void Method1()
  {
      lock(lockObject)
      {
          // task1
      }
  }
  
  // Thread 2
  void Method2()
  {
      lock(lockObject)
      {
          // task2
      }
  }
  </code></pre>