# | Line 624 | Line 624 | public class ThreadPoolExecutor extends | |
---|---|---|
624 | } | |
625 | ||
626 | /** | |
627 | < | * Cause thread to die even if running a task. |
627 | > | * Interrupt thread even if running a task. |
628 | */ | |
629 | void interruptNow() { | |
630 | thread.interrupt(); | |
# | Line 648 | Line 648 | public class ThreadPoolExecutor extends | |
648 | try { | |
649 | task.run(); | |
650 | ran = true; | |
651 | + | // re-clear to avoid needlessly throwing away thread |
652 | + | Thread.interrupted(); |
653 | afterExecute(task, null); | |
654 | ++completedTasks; | |
655 | } catch(RuntimeException ex) { |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |