public synchronized void stop(){
  cancelled=true;
  if (this.taskThread != null) {
    taskThread.interrupt();
    try {
      taskThread.join(2000);
    }
 catch (    InterruptedException e) {
    }
  }
}

public synchronized void stop ( ) { cancelled = true ; if ( this . taskThread != null ) { taskThread . interrupt ( ) ; try { taskThread . join ( 2000 ) ; } catch ( InterruptedException e ) { } } }
cancel the thread . this must be called prior to release .
