protected synchronized void expire() throws IllegalMonitorStateException {
  if (owner == Thread.currentThread()) {
    expired=true;
  }
 else {
    throw new IllegalMonitorStateException("The calling thread is not the owner of the lock!");
  }
}

protected synchronized void expire ( ) throws IllegalMonitorStateException { if ( owner == Thread . currentThread ( ) ) { expired = true ; } else { throw new IllegalMonitorStateException ( "The calling thread is not the owner of the lock!" ) ; } }
sets the status of the headtask to expired .
