public void addTask ( ExecutorTask task ) { for ( int ii = 0 , nn = _queue . size ( ) ; ii < nn ; ii ++ ) { ExecutorTask taskOnQueue = _queue . get ( ii ) ; if ( taskOnQueue . merge ( task ) ) { return ; } } // otherwise, add it on _queue . add ( task ) ; // and perhaps start it going now if ( ! _executingNow ) { checkNext ( ) ; } }
Add a task to the executor it is expected that this method is called on the ResultReceiver thread .