title: C# lock object inside instance object
body: <p>i faced ith situation that force me to lock a lock object that is inside of instance object i want to know is it true or not?</p>
  
  <p>for clarify :</p>
  
  <pre><code>public class classA
  {
      object objLock = new object();
      public void MethodA(object objClassA)
      {
          classA cls = (classA)objClassA;
          lock(cls.objLock)
          {
              Do something with cls
          }
       }
  }
  </code></pre>
  
  <p>is it allowed to do it?</p>