线程池 ThreadPoolExecutor 方法中的 execute方法源码解析
public void execute(Runnable command) {
if (command == null)
throw new NullPointerException();
//ctl 32位的integer的数字,前3位是线程池的状态,后29位是线程池内的线程数量
int c = ctl.get();
// 如果正在运行的线程数小于核心线程数,直接加一个线程
if (workerCountOf(c)
原创
2021-09-22 15:41:46 ·
1036 阅读 ·
0 评论