public void terminated ( ) { try { stateLock . writeLock ( ) . lock ( ) ; if ( ( state == State . Shutdown ) || ( state == State . Running ) ) { state = State . Terminated ; stateChange . signalAll ( ) ; } } finally { stateLock . writeLock ( ) . unlock ( ) ; } }
Makes a transaction from the Running or Shutdown state to the Terminated state or no transition if the current state is not Running or Shutdown .