void runAsync ( ) { // Determine if a task is running. If so, record the fact we want to have it run again, otherwise reserve our spot. synchronized ( this ) { Exceptions . checkNotClosed ( this . closed , this ) ; if ( this . running ) { this . runAgain = true ; return ; } this . running = true ; } // Execute the task. runInternal ( ) ; }
Executes one instance of the task or queues it up at most once should the task be currently running .