用我糟糕的英语阅读DevelopDoc很难
当我在第377行阅读ThreadPoolExecutor
时
private final AtomicInteger ctl = new AtomicInteger(ctlOf(RUNNING, 0));
关于ctl的全部内容。
* The main pool control state, ctl, is an atomic integer packing two
* conceptual fields
* workerCount, indicating the effective number of threads
* runState, indicating whether running, shutting down etc
我猜答案是'控制状态*** ??' 请帮帮我。谢谢。
答案 0 :(得分:0)
正如您在变量ctl
的注释中看到的那样,它用于两件事:
通过在eclipse中使用ctrl + k
跟踪此变量,我发现它包含一些位操作,因此需要一些时间来理解内部的算法,您可以在线找到一些源分析。
猜猜你是中国人,有source analyze关于ThreadPoolExecutor
用中文写的。