Transitions to TERMINATED state if either (SHUTDOWN and pool
and queue empty) or (STOP and pool empty). If otherwise
eligible to terminate but workerCount is nonzero, interrupts an
idle worker to ensure that shutdown signals propagate. This
method must be called following any action that might make
termination possible -- reducing worker count or removing tasks
from the queue during shutdown. The method is non-private to
allow access from ScheduledThreadPoolExecutor.
Transitions to TERMINATED state if either (SHUTDOWN and pool and queue empty) or (STOP and pool empty). If otherwise eligible to terminate but workerCount is nonzero, interrupts an idle worker to ensure that shutdown signals propagate. This method must be called following any action that might make termination possible -- reducing worker count or removing tasks from the queue during shutdown. The method is non-private to allow access from ScheduledThreadPoolExecutor.