public int runAll ( ) { int numTasksRun = 0 ; if ( Thread . currentThread ( ) . equals ( executorThread ) ) { Logger . info ( "ignoring request to execute task - called from executor's own thread" ) ; return numTasksRun ; } while ( hasQueuedTasks ( ) ) { runNext ( ) ; numTasksRun ++ ; } return numTasksRun ; }
Execute all posted tasks and block until they are complete .