public synchronized void execute ( AsyncTask task ) throws JMSException { AsyncTaskProcessorThread thread = threadPool . borrow ( ) ; // Dispatch using new borrowed thread if ( thread != null ) { thread . setTask ( task ) ; thread . execute ( ) ; } else { // All threads are busy ... if ( task . isMergeable ( ) ) { if ( ! taskSet . add ( task ) ) return ; // Already queued } // Enqueue task taskQueue . add ( task ) ; } }
Asynchronously execute the given task