private void waitForBackgroundTasks() {
    if (isBackgroundTaskThread()) {
      return; // fixes bug 42775
    }
    if (backgroundTasks.get() > 0) {
      boolean interrupted = Thread.interrupted();
      try {
        synchronized (backgroundTasks) {
          while (backgroundTasks.get() > 0) {
            try {
              backgroundTasks.wait(500L);
            } catch (InterruptedException ignore) {
              interrupted = true;
            }
          }
        }
      } finally {
        if (interrupted) {
          Thread.currentThread().interrupt();
        }
      }
    }
  }
stops the compactor outside the write lock. Once stopped then it proceeds to destroy the
current & old oplogs
geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java