public synchronized boolean advanceToLastPostedRunnable ( ) { long currentMaxTime = currentTime ; for ( ScheduledRunnable scheduled : runnables ) { if ( currentMaxTime < scheduled . scheduledTime ) { currentMaxTime = scheduled . scheduledTime ; } } return advanceTo ( currentMaxTime ) ; }
Run all runnables in the queue and any additional runnables they schedule that are scheduled before the latest scheduled runnable currently in the queue .