public synchronized boolean isIdle(){
  if (!isRunning()) {
    idle=true;
synchronized (idleSync) {
      idleSync.notifyAll();
    }
  }
  return idle;
}

public synchronized boolean isIdle ( ) { if ( ! isRunning ( ) ) { idle = true ; synchronized ( idleSync ) { idleSync . notifyAll ( ) ; } } return idle ; }
have all commands completed executing ?
