...
Similarly, tasks that use some mechanism other than Thread.interrupted()
to determine when to shutdown will be unresponsive to shutdown()
or shutdownNow()
. For instance, tasks that check a volatile
flag to determine whether it is safe to shutdown will be unresponsive to these methods. The guideline CON13CON24-J. Do not use Thread.stop() to terminate threads provides more information on using a flag to terminate threads.
...