Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8289610 Degrade Thread.stop
  3. JDK-8293852

Release Note: Thread.Stop Changed to Throw UnsupportedOperationException

    XMLWordPrintable

Details

    Description

      The ability to "stop" a thread with the `Thread.stop()` method has been removed in this release. The method has been changed to throw `UnsupportedOperationException`. Stopping a thread by causing it to throw `java.lang.ThreadDeath` was inherently unsafe. The `stop` method has been deprecated since JDK 1.2 (1998). The corresponding method in `ThreadGroup`, to "stop" a group of threads, was changed to throw `UnsupportedOperationException` in Java 19.

      As part of this change, `java.lang.ThreadDeath` has been deprecated for removal.

      Attachments

        Activity

          People

            alanb Alan Bateman
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: