public static void removeTimer ( ScheduledTimer timer ) { Preconditions . checkNotNull ( timer , "timer" ) ; try ( LockResource r = new LockResource ( sLock ) ) { ScheduledTimer removedTimer = sTimers . remove ( timer . getThreadName ( ) ) ; Preconditions . checkNotNull ( removedTimer , "sTimers should contain %s" , timer . getThreadName ( ) ) ; Preconditions . checkState ( removedTimer == timer , "sTimers should contain the timer being removed" ) ; } }
Removes a timer from the scheduler .