workerCountOf() method in ThreadPoolExecutor java
问题 I am trying to understand ThreadPoolExecutor class.I found some final variables declared in that class and unable to understand their use. private final AtomicInteger ctl = new AtomicInteger(ctlOf(RUNNING, 0)); private static final int COUNT_BITS = Integer.SIZE - 3; //29 private static final int CAPACITY = (1 << COUNT_BITS) - 1; //536870911 00011111111111111111111111111111 // RUN_STATE is stored in the high-order bits private static final int RUNNING = -1 << COUNT_BITS; //-536870912