Java ThreadPoolExecutor源码解析之Execute流程

execute方法示意图如上,workers为HashSet类型,存储初始化任务RUNNING或SHUTDOWN但firsttask为null的worker。
workQueue为BlockingQueue,存储提交的执行任务。

execute方法示意图如上,workers为HashSet类型,存储初始化任务RUNNING或SHUTDOWN但firsttask为null的worker。
workQueue为BlockingQueue,存储提交的执行任务。