title: Does reentrant lock in concurrenthashmap uses it's optional “fairness” parameter?
body: <p>In ConcurrentHashMap we have segments which basically extend ReentrantLock. </p>
  
  <pre><code>static final class Segment&lt;K,V&gt; extends ReentrantLock implements Serializable
  </code></pre>
  
  <p>Does this ReentrantLock use it's fairness property?</p>
  
  <pre><code>public ReentrantLock(boolean fair) {
      sync = fair ? new FairSync() : new NonfairSync();
  }
  </code></pre>
  
  <p>So lets say thread t1 has read lock on a partition of ConcurrentHashMap and another two threads t2 and t3 are waiting for read and write locks respectively on the same partition. So which one(t2 or t3) will acquire the the lock once t1 releases it's lock. </p>
  
  <p>As per my knowledge it would be the one who is waiting for the longest if fairness is set to true. But is it set to true in the case of concurrentHashMap? If no can we say with any certainty which thread would get the next lock?</p>