public boolean removeElement(Object obj){
synchronized (actions) {
    if (allowToChange) {
      boolean result=actions.remove(obj);
      if (actions.isEmpty()) {
        if (headTask != null) {
          cancel();
        }
      }
      return result;
    }
  }
  return false;
}

public boolean removeElement ( Object obj ) { synchronized ( actions ) { if ( allowToChange ) { boolean result = actions . remove ( obj ) ; if ( actions . isEmpty ( ) ) { if ( headTask != null ) { cancel ( ) ; } } return result ; } } return false ; }
removes an element from this instantrunnable .
