* How is it that the worker thread is left in a state where the interrupt status is set?
* Why does the default implementation not clear the interrupt status before starting a new task?
Ответы:
- Не прервано.
- Реализация, но вы не смотритеправильное место
Из кода библиотеки Oracle:
/*
* Ensure that unless pool is stopping, this thread
* does not have its interrupt set. This requires a
* double-check of state in case the interrupt was
* cleared concurrently with a shutdownNow -- if so,
* the interrupt is re-enabled.
*/
if (runState < STOP &&
Thread.interrupted() &&
runState >= STOP)
thread.interrupt();
Как видите, состояние прерывания очищается из рабочего потока, пока исполнитель не выключается.