code: private void setAndStartTask(ICBTask task){
          task.setTaskListener(new CBTaskListener() {
              @Override
              public void onTaskStart() {
                  lock.lock();
                  if (currentExecuteTaskNumber > maxTaskNumber) {
                      try {
                          condition.await();
                      } catch (InterruptedException e) {
                          e.printStackTrace();
                      }
                  }
                  currentExecuteTaskNumber++;
                  lock.unlock();
              }
  
              @Override
              public void onTaskEnd() {
                  lock.lock();
                  currentExecuteTaskNumber--;
                  condition.signal();
                  lock.unlock();
              }
          });
  
          task.startTask();
      }
docs: 设置任务的监听器并开始任务
  @param task 任务