title: Is this lock usage thread safe?
body: <p>I know that is wrong to use <code>lock(this)</code> or any shared object.</p>
  
  <p>I wonder if this usage is OK?</p>
  
  <pre><code>public class A
  {
    private readonly object locker = new object();
    private List&lt;int&gt; myList;
    public A()
    {
      myList = new List&lt;int&gt;()
    }
  
    private void MethodeA()
    {
      lock(locker)
      {
        myList.Add(10);
      }
    }
  
    public void MethodeB()
    {
      CallToMethodInOtherClass(myList);
    }
  }
  
  public class OtherClass
  {
    private readonly object locker = new object();
    public CallToMethodInOtherClass(List&lt;int&gt; list)
    {
     lock(locker)
     {
       int i = list.Count;
     }
    }
  }
  </code></pre>
  
  <p>Is this thread safe? In <code>OtherClass</code> we lock with a private object so if the <code>class A</code> lock with its private lock can the list still change in the the lock block in <code>OtherClass</code>?</p>