# | Line 893 | Line 893 | public class ThreadPoolExecutor extends | |
---|---|---|
893 | ||
894 | if (isRunning(c) || | |
895 | (runStateLessThan(c, STOP) && firstTask == null)) { | |
896 | < | if (t.isAlive()) // precheck that t is startable |
896 | > | if (t.getState() != Thread.State.NEW) |
897 | throw new IllegalThreadStateException(); | |
898 | workers.add(w); | |
899 | + | workerAdded = true; |
900 | int s = workers.size(); | |
901 | if (s > largestPoolSize) | |
902 | largestPoolSize = s; | |
902 | – | workerAdded = true; |
903 | } | |
904 | } finally { | |
905 | mainLock.unlock(); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |