# | Line 413 | Line 413 | public class ThreadPoolExecutor extends | |
---|---|---|
413 | * @return the new thread, or null if threadFactory fails to create thread | |
414 | */ | |
415 | private Thread addThread(Runnable firstTask) { | |
416 | + | if (runState == TERMINATED) // Don't create thread if terminated |
417 | + | return null; |
418 | Worker w = new Worker(firstTask); | |
419 | Thread t = threadFactory.newThread(w); | |
420 | if (t != null) { |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |