title: Would you explain lock ordering?
body: <p>I learned that I should unlock reverse order to lock order.
  For example.</p>
  
  <pre><code>A.lock();
  B.lock();
  B.unlock();
  A.unlock();
  </code></pre>
  
  <p>But, what happen if I did like this :</p>
  
  <pre><code>A.lock();
  B.lock();
  A.unlock();
  B.unlock();
  </code></pre>
  
  <p>I try to make a deadlock scenario,
  but if I always lock A earlier then B, then I don't know how deadlock would happen.
  Would you help me?</p>