private void scheduleAlarm ( long timeOut ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "scheduleAlarm timeOut=" + timeOut ) ; // NB PM27294 implementation now means you cannot decrease the the timeOut if an alarm is already scheduled. // This is OK for the expirer as the timeout does not change once Expirer is started. synchronized ( lockObject ) { // if there is not an alarm already scheduled and there exists no thread that will go on to call scheduleAlarm then // create an alarm. if ( ! alarmScheduled && ! alarming ) { expiryAlarm = AlarmManager . createNonDeferrable ( timeOut , this ) ; alarmScheduled = true ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "scheduleAlarm" , alarmScheduled ) ; }
Schedule the next alarm . Callers of this method would typically hold lockObject already .