public UCIBestMove stop(){
  if (!isConnected()) {
    throw new IllegalStateException("Engine is not connected.");
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("Entering stop(...)");
  }
  UCIBestMove result=null;
synchronized (stopSynch) {
    if (!isProcessingGo()) {
      result=lastBestMove;
      lastBestMove=null;
    }
 else {
      long totalSleepTime=0;
      send("stop");
      while (goRunnable != null && totalSleepTime < 2500) {
        try {
          Thread.sleep(500);
          totalSleepTime+=500;
        }
 catch (        InterruptedException ie) {
        }
      }
      result=lastBestMove;
      lastBestMove=null;
    }
  }
  return result;
}

public UCIBestMove stop ( ) { if ( ! isConnected ( ) ) { throw new IllegalStateException ( "Engine is not connected." ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Entering stop(...)" ) ; } UCIBestMove result = null ; synchronized ( stopSynch ) { if ( ! isProcessingGo ( ) ) { result = lastBestMove ; lastBestMove = null ; } else { long totalSleepTime = 0 ; send ( "stop" ) ; while ( goRunnable != null && totalSleepTime < 2500 ) { try { Thread . sleep ( 500 ) ; totalSleepTime += 500 ; } catch ( InterruptedException ie ) { } } result = lastBestMove ; lastBestMove = null ; } } return result ; }
stops a go that is in process . the ucibestmove is returned .
