title: why std::lock() supports deallock avoidence but std::try_lock() does not?
body: <p>I thought the difference between <code>std::lock()</code> and <code>std::try_lock()</code>  is only  in <code>try_lock()</code> ,  if locks are not available ,  immediately it will return false while in the case of <code>std::lock()</code>, it will go in blocked state.</p>
  
  <p><a href="http://en.cppreference.com/w/cpp/thread/lock" rel="noreferrer">Cpp reference for std::lock </a></p>
  
  <pre><code>void lock( Lockable1&amp; lock1, Lockable2&amp; lock2, LockableN&amp;... lockn );
  </code></pre>
  
  <p>Locks the given Lockable objects lock1, lock2, ..., lockn using a <strong>deadlock avoidance algorithm</strong> to avoid deadlock. </p>
  
  <p><a href="http://en.cppreference.com/w/cpp/thread/try_lock" rel="noreferrer">Cpp reference by try_lock</a></p>
  
  <pre><code>int try_lock( Lockable1&amp; lock1, Lockable2&amp; lock2, LockableN&amp;... lockn);
  </code></pre>
  
  <p>Tries to lock each of the given Lockable objects lock1, lock2, ..., lockn by calling try_lock in order <strong>beginning with the first</strong>. </p>
  
  <p>I have following two questions:</p>
  
  <ol>
  <li>Why <code>std::lock()</code> provides deadlock avoidence but <code>std::try_lock</code> doesn't?</li>
  <li>why in <code>std::lock</code> , order of lock doesn't matter( it could be lock2 , lock 3, lock1, ...) while in <code>std::try_lock()</code> order of locks are maintained (lock1, lock2, lock3....)</li>
  </ol>