@Override
    public void awaitNanos(final long timeout) throws InterruptedException {
        long remaining = timeout;
        queueLock.lock();
        try {
            while(test() && remaining > 0) {
                remaining = condition.awaitNanos(remaining);
            }
        }
        finally {
            queueLock.unlock();
        }
    }
@ Override public void awaitNanos ( final long timeout ) throws InterruptedException { long remaining = timeout ; queueLock . lock ( ) ; try { while ( test ( ) && remaining > 0 ) { remaining = condition . awaitNanos ( remaining ) ; } } finally { queueLock . unlock ( ) ; } }
wake me when the condition is satisfied, or timeout