Programs may submit _only_ tasks that support interruption using {{ Wiki Markup Thread.interrupt()
}} to thread pools that require the ability to shut down the thread pool or to cancel individual tasks within the pool. Programs must not submit tasks that lack interruption support to such thread pools. According to the Java API interface \[ [API 2006|AA. References#API 06]\], the {{java.util.concurrent.ExecutorService.shutdownNow()
}} method
...attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution. There are no guarantees beyond best-effort attempts to stop processing actively executing tasks. For example, typical implementations will cancel via
Thread.interrupt()
, so any task that fails to respond to interrupts may never terminate.
...
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
TPS02-J | low | probable | medium | P4 | L3 |
Bibliography
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="176177db-2090-4c68-abe3-de013bfa73c3"><ac:plain-text-body><![CDATA[ | [ [API 2006AA. References#API 06]] | interface |
[CDATA[ [[Goetz 2006aAA. References#Goetz 06]] | Chapter 7, Cancellation and Shutdown ]]></ac:plain-text-body></ac:structured-macro> |
...