Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • If ThreadDeath is left uncaught, it allows the execution of a finally block which performs the usual cleanup operations. Use of the Thread.stop() method is highly inadvisable especially when ThreadDeath is left uncaught because of two reasons. First, no particular thread can be forcefully stopped because an arbitrary thread can catch the thrown ThreadDeath exception and simply choose to ignore it. Second, abruptly stopping a thread results in the release of all the locks that it has acquired, violating the guarantees provided by the critical sections. Moreover, the objects end up in an inconsistent state, non-deterministic behavior being a typical outcome.

...