public List<BaseDownloadTask> shutdown() {
        synchronized (finishCallback) {
            if (workingTask != null) {
                pause();
            }

            final List<BaseDownloadTask> unDealTaskList = new ArrayList<>(pausedList);
            pausedList.clear();
            mHandler.removeMessages(WHAT_NEXT);
            mHandlerThread.interrupt();
            mHandlerThread.quit();

            return unDealTaskList;
        }
    }
public List<BaseDownloadTask> shutdown() {
        synchronized (finishCallback) {
            if (workingTask != null) {
                pause();
            }

            final List<BaseDownloadTask> unDealTaskList = new ArrayList<>(pausedList);
            pausedList.clear();
            mHandler.removeMessages(WHAT_NEXT);
            mHandlerThread.interrupt();
            mHandlerThread.quit();

            return unDealTaskList;
        }
    }
public List < BaseDownloadTask > shutdown ( ) { synchronized ( finishCallback ) { if ( workingTask != null ) { pause ( ) ; } final List < BaseDownloadTask > unDealTaskList = new ArrayList <> ( pausedList ) ; pausedList . clear ( ) ; mHandler . removeMessages ( WHAT_NEXT ) ; mHandlerThread . interrupt ( ) ; mHandlerThread . quit ( ) ; return unDealTaskList ; } }
Attempts to stop the working task, halts the processing of waiting tasks, and returns a list
of the tasks that were awaiting execution. These tasks are drained (removed) from the task
queue upon return from this method.
Attempts to stop the working task halts the processing of waiting tasks and returns a list of the tasks that were awaiting execution . These tasks are drained ( removed ) from the task queue upon return from this method .