再进入主题之前,我们先了解几个概念,对读源码有所帮助,对于线程池的运行状态,有4个级别,分别是RUNNING,SHUTING,STOP,TIDING,TERMINATED 解释如下: The runState provides the main lifecycle control, taking on values: * * RUNNING: Accept new tasks and process queued tasks //能接受新的任务,并且可以运行已经在任务队列中的任务 * SHUTD…