public int peek ( long timeout , TimeUnit unit ) throws InterruptedException , TimeoutException { // non volatile read ( which is quicker ) final int readLocation = this . consumerReadLocation ; blockForReadSpace ( timeout , unit , readLocation ) ; // purposely not volatile as the read memory barrier occurred above when we read ' this.readLocation' return data [ readLocation ] ; }
Retrieves but does not remove the head of this queue .