Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8277861

Terminally deprecate Thread.stop

XMLWordPrintable

    • b26

      Thread.stop is inherently unsafe and has been deprecated since Java 1.2. In addition to being unsafe for applications and libraries to use, it works inconsistently and creates a burden on the runtime to have to deal with "async" exceptions at sensitive times. Project Loom is planning virtual threads that will not support Thread.stop. All told, it's time to terminally deprecate this method so it can be degraded and removed in the future.

      Terminally deprecating Thread.stop has no impact on JVM TI StopThread. This is used by debugger to have threads throw an exception when resumed at a breakpoint. Further work is required to find an alternative before deprecating the JVM TI function (and corresponding method in JDI and command in JDWP).

        There are no Sub-Tasks for this issue.

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

              Created:
              Updated:
              Resolved: