presto-main/src/main/java/io/prestosql/operator/exchange/LocalExchangeSource.java/LocalExchangeSource/waitForReading
class LocalExchangeSource:    public ListenableFuture<?> waitForReading()
    {
        checkNotHoldsLock();

        synchronized (lock) {
            // if we need to block readers, and the current future is complete, create a new one
            if (!finishing && buffer.isEmpty() && notEmptyFuture.isDone()) {
                notEmptyFuture = SettableFuture.create();
            }
            return notEmptyFuture;
        }
    }