@Override
    public LogEntry peek() {
      LogEntry entry = queue.peek();
      if (entry == null) {
        synchronized (this) {
          entry = queue.peek();
          while (entry == null) {
            boolean interrupted = Thread.interrupted();
            try {
              wait();
              entry = queue.peek();
            } catch (InterruptedException e) {
              interrupted = true;
            } finally {
              if (interrupted) {
                Thread.currentThread().interrupt();
              }
            }
          }
        }
      }
      return entry;
    }
Peeks at the oldest log entry read from the log file, waits for a log entry to become
available.

@return {@code null} if interrupted while waiting
geode-core/src/main/java/org/apache/geode/internal/logging/MergeLogFiles.java