再看看源码java.util.concurrent.ThreadPoolExecutor.java
public void execute(Runnable command) { if (command == null) throw new NullPointerException(); int c = ctl.get(); //判断当前活跃线程数是否小于corePoolSize if (workerCountOf(c) < corePoolSize) { //如果小于,则调用addWorker创建线程执行任务 if (addWorker(command, true)) return; c = ctl.get(); } //如果大于等于corePoolSize,则将任务添加到workQueue队列 if (isRunning(c) && workQueue.offer(command)) { int recheck = ctl.get(); if (! isRunning(recheck) && remove(command)) reject(command); else if (workerCountOf(recheck) == 0) addWorker(null, false); } //如果放入workQueue队列失败,则创建非核心线程执行任务 else if (!addWorker(command, false)) reject(command); }