class ParallelRecompilationViewProcessWorker implements ViewProcessWorker {

  @Override
  public void join() throws InterruptedException {
    s_logger.info("Joining worker(s)");
    do {
      ViewProcessWorker primary;
      synchronized (this) {
        if (getPrimary() == null) {
          break;
        }
        primary = getPrimary()._worker;
      }
      s_logger.debug("Joining primary worker {}", primary);
      primary.join();
      synchronized (this) {
        if (getPrimary() == null) {
          break;
        } else {
          if (getPrimary()._worker == primary) {
            if (getSecondary() != null) {
              promoteSecondaryWorker();
            } else {
              _primary = null;
              break;
            }
          } else {
            s_logger.debug("Primary worker {} changed to {} during wait", primary, getPrimary());
          }
        }
      }
    } while (true);
    s_logger.debug("Primary worker joined");
  }

  public  ParallelRecompilationViewProcessWorker(final ViewProcessWorkerFactory delegate, final ViewProcessWorkerContext context, final ViewExecutionOptions options,
      final ViewDefinition viewDefinition);

}