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

Thread::exit should be immune to Thread.stop

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P3
    • 19
    • 19
    • hotspot
    • b15

    Description

      Thread::exit runs tear-down/cleanup code before a Thread terminates. It's impossible to reason about how this code might behave with an async exception.

      HotSpot has historically invoked the method up to 3 times or until the Thread.group field is null. That may have worked but this code will likely change significantly with loom. It's harder to reason about how the new code may behave with an async exception.

      Thread.stop is terminally deprecated and will likely be degraded to throw UOE in a release or two. This removes it from the user facing API but async exceptions are still possible with the debugger APIs.

      This issue tracks exploring if Thread::exit can be made immune to async exceptions. Maybe a new terminating state can be introduced so that sending an async exception does nothing when the thread is exiting.

      Attachments

        Issue Links

          Activity

            People

              dholmes David Holmes
              alanb Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: