Use of ATC for Thread Termination

Calling the interrupt method on a cooperative real-time thread will terminate that thread safely and quickly.

If a thread was written to expect AIEs and to behave well in that environment, it will frequently visit methods that throw AIE. Since the exception thrown by the interrupt method does not match any AIE on the call stack, the exception will propagate through all appropriate finally clauses, catch clauses, and interruptAction methods back through the thread's runnable method and the thread will terminate.

Nothing happens if an application calls the interrupt method on a thread that never calls a method that throws AsynchronouslyInterruptedException, never polls its interrupted flag, and never responds to ...

Get Real-Time Java™ Platform Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.