private boolean removeTask(Task t,int min){
  for (int i=tasks.size(); --i >= min; ) {
    if (tasks.get(i) == t) {
      tasks.remove(i);
      if (i < firstPending) {
        firstPending--;
        for (int j=threads.size(); --j >= 0; ) {
          TaskThread thread=threads.get(j);
          if (thread.task == t) {
            if (thread != Thread.currentThread())             thread.interrupt();
            break;
          }
        }
      }
      return true;
    }
  }
  return false;
}

private boolean removeTask ( Task t , int min ) { for ( int i = tasks . size ( ) ; -- i >= min ; ) { if ( tasks . get ( i ) == t ) { tasks . remove ( i ) ; if ( i < firstPending ) { firstPending -- ; for ( int j = threads . size ( ) ; -- j >= 0 ; ) { TaskThread thread = threads . get ( j ) ; if ( thread . task == t ) { if ( thread != Thread . currentThread ( ) ) thread . interrupt ( ) ; break ; } } } return true ; } } return false ; }
remove a task if it has index > = min . if it is active and not being executed by the calling thread , interrupt the thread executing the task .
