private void timeout ( ) { lock . writeLock ( ) . lock ( ) ; try { //if already stopped, do nothing, otherwise check times and run the timeout task if ( ! this . stopped ) { long now = System . nanoTime ( ) ; long remaining = this . targetEnd - now ; this . timedout = remaining <= FTConstants . MIN_TIMEOUT_NANO ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { debugTime ( "!Start {0}" , this . start ) ; debugTime ( "!Target {0}" , this . targetEnd ) ; debugTime ( "!Now {0}" , now ) ; debugTime ( "!Remain {0}" , remaining ) ; } //if we really have timedout then run the timeout task if ( this . timedout ) { debugRelativeTime ( "Timeout!" ) ; this . timeoutTask . run ( ) ; } else { //this shouldn't be possible but if the timer popped too early, restart it debugTime ( "Premature Timeout!" , remaining ) ; start ( this . timeoutTask , remaining ) ; } } } finally { lock . writeLock ( ) . unlock ( ) ; } }
This method is run when the timer pops