public boolean await()

in hugegraph-common/src/main/java/org/apache/hugegraph/concurrent/BarrierEvent.java [54:74]


    public boolean await(long timeout) throws InterruptedException {
        E.checkArgument(timeout >= 0L,
                        "The time must be >= 0, but got '%d'.",
                        timeout);
        long deadline = System.currentTimeMillis() + timeout;
        this.lock.lock();
        try {
            while (!this.signaled) {
                timeout = deadline - System.currentTimeMillis();
                if (timeout > 0) {
                    this.cond.await(timeout, TimeUnit.MILLISECONDS);
                }
                if (System.currentTimeMillis() >= deadline) {
                    return this.signaled;
                }
            }
        } finally {
            this.lock.unlock();
        }
        return true;
    }