File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -325,14 +325,14 @@ pool-1-thread-2 End. Time = Sun Apr 12 11:14:47 CST 2020
325325 int c = ctl. get();
326326
327327 // 下面会涉及到 3 步 操作
328- // 1.首先判断当前线程池中之行的任务数量是否小于 corePoolSize
328+ // 1.首先判断当前线程池中执行的任务数量是否小于 corePoolSize
329329 // 如果小于的话,通过addWorker(command, true)新建一个线程,并将任务(command)添加到该线程中;然后,启动该线程从而执行任务。
330330 if (workerCountOf(c) < corePoolSize) {
331331 if (addWorker(command, true ))
332332 return ;
333333 c = ctl. get();
334334 }
335- // 2.如果当前之行的任务数量大于等于 corePoolSize 的时候就会走到这里
335+ // 2.如果当前执行的任务数量大于等于 corePoolSize 的时候就会走到这里
336336 // 通过 isRunning 方法判断线程池状态,线程池处于 RUNNING 状态并且队列可以加入任务,该任务才会被加入进去
337337 if (isRunning(c) && workQueue. offer(command)) {
338338 int recheck = ctl. get();
@@ -394,7 +394,7 @@ pool-1-thread-2 End. Time = Sun Apr 12 11:14:47 CST 2020
394394 for (;;) {
395395 // 获取线程池中工作的线程的数量
396396 int wc = workerCountOf(c);
397- // core参数为true的话表明队列也满了 ,线程池大小变为 maximumPoolSize
397+ // core参数为false的话表明队列也满了 ,线程池大小变为 maximumPoolSize
398398 if (wc >= CAPACITY ||
399399 wc >= (core ? corePoolSize : maximumPoolSize))
400400 return false ;
You can’t perform that action at this time.
0 commit comments