public void cancelQueuedTasks ( ) { ArrayList < QueueingTask > queuedTasks = new ArrayList < QueueingTask > ( ) ; queue . drainTo ( queuedTasks ) ; for ( QueueingTask task : queuedTasks ) { task . cancel ( false ) ; } }
When stopping cancel any queued tasks .