public synchronized boolean runOneTask ( ) { ScheduledRunnable postedRunnable = runnables . poll ( ) ; if ( postedRunnable != null ) { if ( postedRunnable . scheduledTime > currentTime ) { currentTime = postedRunnable . scheduledTime ; } postedRunnable . run ( ) ; return true ; } return false ; }
Run the next runnable in the queue .