title: C# threading and synchronization
body: <p>I have a private static field which I use for synchronization (lock). Now I have two functions which I don't want to execute concurrently. So I did this: </p>
  
  <pre><code>public class Synchronization
  {
      private static object _lock = new object();
  
      public void MethodA()
      {
          lock (_lock)
          {
              Console.WriteLine("I shouldn't execute with MethodB");
          }
      }
  
      public void MethodB()
      {
          lock (_lock)
          {
              Console.WriteLine("I shouldn't execute with MethodA");
          }
      }
  }
  </code></pre>
  
  <p>I know that locking on an object will prevent parallel execution of a single function, but will the same work if I use the same lock object in different methods which run concurrently? Simply, put can any other thread acquire lock on an already locked object in another function?</p>