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.
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.
- blocks
-
JDK-8285507 revert fix for JDK-8282704 now that JDK-8282952 is fixed
-
- Resolved
-
- relates to
-
JDK-8283467 runtime/Thread/StopAtExit.java needs updating
-
- Resolved
-
-
JDK-8282704 runtime/Thread/StopAtExit.java may leak memory
-
- Resolved
-
-
JDK-8283610 runtime/Thread/StopAtExit.java failing in loom repo
-
- Resolved
-
(1 links to)