public void startAllTasksAndWaiting() throws InterruptedException {
        List<ICBTask> taskList = new ArrayList<>();
        while (queue.size() != 0 && !stopSign) {
            ICBTask task = queue.poll();
            if (task == null) {
                continue;
            }
            taskList.add(task);
            setAndStartTask(task);
        }
        for(ICBTask task:taskList){
            if(!task.isTaskFinished()){
                task.waitForEnd();
            }
        }
    }
public void startAllTasksAndWaiting() throws InterruptedException {
        List<ICBTask> taskList = new ArrayList<>();
        while (queue.size() != 0 && !stopSign) {
            ICBTask task = queue.poll();
            if (task == null) {
                continue;
            }
            taskList.add(task);
            setAndStartTask(task);
        }
        for(ICBTask task:taskList){
            if(!task.isTaskFinished()){
                task.waitForEnd();
            }
        }
    }
public void startAllTasksAndWaiting ( ) throws InterruptedException { List < ICBTask > taskList = new ArrayList <> ( ) ; while ( queue . size ( ) != 0 && ! stopSign ) { ICBTask task = queue . poll ( ) ; if ( task == null ) { continue ; } taskList . add ( task ) ; setAndStartTask ( task ) ; } for ( ICBTask task : taskList ) { if ( ! task . isTaskFinished ( ) ) { task . waitForEnd ( ) ; } } }
开始执行并且等待结束
@throws InterruptedException exception
开始执行并且等待结束