public void cancel(Ticket t){
synchronized (contents) {
    if (dead)     return;
    contents.remove(t);
    checkHead();
  }
}

public void cancel ( Ticket t ) { synchronized ( contents ) { if ( dead ) return ; contents . remove ( t ) ; checkHead ( ) ; } }
cancel the given ticket .
