Friday, June 28, 2019

Java thread stoppage can be blocked by an error handler

Calling stop on a thread object in Java isn't the same as terminating the thread from the OS perspective. Rather, it causes Java to throw a ThreadDeath wherever the target thread currently is. This throwable goes up the call stack like a normal throwable. If it is caught (e.g. by catching all Errors or all Throwables) and not rethrown, the thread can continue.

No comments:

Post a Comment