int blockForReadSpace(long timeout, TimeUnit unit, int readLocation) throws TimeoutException {

        // sets the nextReadLocation my moving it on by 1, this may cause it it wrap back to the start.
        final int nextReadLocation = (readLocation + 1 == capacity) ? 0 : readLocation + 1;

        final long timeoutAt = System.nanoTime() + unit.toNanos(timeout);

        // in the for loop below, we are blocked reading unit another item is written, this is because we are empty ( aka size()=0)
        // inside the for loop, getting the 'writeLocation', this will serve as our read memory barrier.

        while (writeLocation == readLocation)
            if (!blockAtTake(timeoutAt))
                throw new TimeoutException();

        return nextReadLocation;
    }
int blockForReadSpace ( long timeout , TimeUnit unit , int readLocation ) throws TimeoutException { final int nextReadLocation = ( readLocation + 1 == capacity ) ? 0 : readLocation + 1 ; final long timeoutAt = System . nanoTime ( ) + unit . toNanos ( timeout ) ; while ( writeLocation == readLocation ) if ( ! blockAtTake ( timeoutAt ) ) throw new TimeoutException ( ) ; return nextReadLocation ; }
@param timeout      how long to wait before giving up, in units of
<tt>unit</tt>
@param unit         a <tt>TimeUnit</tt> determining how to interpret the
<tt>timeout</tt> parameter
@param readLocation we want to minimize the number of volatile reads, so we read the readLocation just once and get it passed in
@return
@throws TimeoutException