private boolean await0(long timeoutMillis, boolean interruptable) throws InterruptedException {
        if (isDone()) {
            return true;
        }

        if (timeoutMillis <= 0) {
            return isDone();
        }

        if (interruptable && Thread.interrupted()) {
            throw new InterruptedException(toString());
        }

        long endTime = SystemClock.now() + timeoutMillis;

        boolean interrupted = false;

        synchronized (lock) {
            if (isDone()) {
                return true;
            }

            if (timeoutMillis <= 0) {
                return isDone();
            }

            try {
                for (; ; ) {

                    long timeOut = Math.min(timeoutMillis, DEAD_LOCK_CHECK_INTERVAL);
                    try {
                        lock.wait(timeOut);
                    } catch (InterruptedException e) {
                        if (interruptable) {
                            throw e;
                        } else {
                            interrupted = true;
                        }

                    }

                    if (isDone()) {
                        return true;
                    }

                    if (endTime < SystemClock.now()) {
                        return isDone();
                    }
                }
            } finally {
                if (interrupted) {
                    Thread.currentThread().interrupt();
                }
            }
        }
    }
A lock used by the wait() method
lts-core/src/main/java/com/github/ltsopensource/nio/handler/IoFuture.java