ThreadPoolExecutor源码解析一
ThreadPoolExecutor源码解析属性线程状态相关方法相关属性构造方法execute()addWorker()
属性
// 用于存放线程池状态(前3位)+工作线程数(后29位)
private final AtomicInteger ctl = new AtomicInteger(ctlOf(RUNNING, 0));
// 29位
private static final int COUNT_BITS = Integer.SIZE - 3;
// 线程池的最大线程数容量 0001 1111
原创
2021-03-21 19:24:36 ·
285 阅读 ·
0 评论