docs: public ReturnCode waitForStart(ProcessStatus ps) {
          FileOutputStream fos = null;
          FileChannel fc = null;
  
          try {
              // Try for a short period of time to obtain the lock
              // (if status mechanisms temporarily grab the file, we want to wait
              // to try to grab it.. )
              int attempts = 0;
              boolean fileObtained = true;
  
              int waitCycles = this.calculateWaitCyclesFromWaitTime();
  
              while (fileObtained && attempts++ < waitCycles) {
                  try {
                      // wait: allow other process to obtain the lock file
                      Thread.sleep(BootstrapConstants.POLL_INTERVAL_MS);
  
                      if (lockFile.exists()) {
                          try {
                              if (lockFileChannel == null) {
                                  fos = new FileOutputStream(lockFile);
                                  fc = fos.getChannel();
                                  lockFileChannel = fc;
                              }
  
                              fileObtained = tryServerLock();
                          } catch (IOException e) {
                              Debug.printStackTrace(e);
                              return ReturnCode.ERROR_SERVER_START;
                          }
                      }
                  } catch (InterruptedException ie) {
                  }
  
                  // If we obtained the file lock, then the server did not start.
                  // If we also detect that the server process is not possibly
                  // running, then there is no reason to continue polling.  By
                  // checking this condition, we can poll for longer without
                  // worrying about "hanging" when the server process fails to
                  // launch altogether (invalid JAVA_HOME, JVM options, etc.).
                  if (fileObtained && (ps.isPossiblyRunning() == State.NO)) {
                      return ReturnCode.ERROR_SERVER_START;
                  }
              }
  
              if (fileObtained) {
                  // Server did not start
                  return ReturnCode.ERROR_SERVER_START;
              }
          } finally {
              releaseServerLock();
          }
          return ReturnCode.OK;
      }