# | Line 892 | Line 892 | public class ThreadPoolExecutor extends | |
---|---|---|
892 | boolean workerStarted = false; | |
893 | Worker w = null; | |
894 | try { | |
895 | + | final ReentrantLock mainLock = this.mainLock; |
896 | w = new Worker(firstTask); | |
897 | final Thread t = w.thread; | |
898 | < | final ReentrantLock mainLock = this.mainLock; |
898 | > | if (t.isAlive()) // precheck that t is startable |
899 | > | throw new IllegalThreadStateException(); |
900 | mainLock.lock(); | |
901 | try { | |
902 | // Recheck while holding lock. |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |