private boolean addWorker(Runnable firstTask, boolean core) {// 定义一个标签retry:for (;;) {int c = ctl.get();int rs = runStateOf(c);// Check if queue empty only if necessary.if (rs >= SHUTDOWN &&! (rs == SHUTDOWN &&firstTask == null &&! workQueue.isEmpty()))return false;for (;;) {int wc = workerCountOf(c);if (wc >= CAPACITY ||wc >= (core ? corePoolSize : maximumPoolSize))return false;if (compareAndIncrementWorkerCount(c))// 这里循环出来break retry;c = ctl.get(); // Re-read ctlif (runStateOf(c) != rs)// 这里走到标签那里continue retry;// else CAS failed due to workerCount change; retry inner loop}}...}
