On Wed, 7 Sep 2022 02:04:13 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:

> THREAD_NOT_ALIVE originates from JVMTI. However, the debug agent converts it 
> to INVALID_THREAD before passing it on to the debug agent client (the 
> debugger, usually JDI), so debug agent users (JDI) should never see it. 
> Currently ThreadReference.forceEarlyReturn() is the only API that even 
> bothers to check for it, and it throws 
> com.sun.jdi.IllegalThreadStateException, which is the same thing it already 
> does for INVALID_THREAD.
> 
> In the JDWP spec I change the description of THREAD_NOT_ALIVE  to "Not used". 
> If you have a suggestion for better wording, please let me now. (I was 
> thinking maybe "Unused" would be better.
> 
> In the JDI ThreadReference.forceEarlyReturn implementation, I removed the 
> code that checks for THREAD_NOT_ALIVE since it should never occur. There is 
> no behavior change associated with this change, and there is no JDI spec 
> update necessary. The spec already says IllegalThreadStateException means 
> "the thread is not suspended", and not being alive implies not suspended.
> 
> Note the JDWP spec for ThreadReference.ForceEarlyReturn used to mention 
> THREAD_NOT_ALIVE as a possible error code, but it was removed as part of the 
> loom work.

This pull request has now been integrated.

Changeset: aff9a696
Author:    Chris Plummer <cjplum...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/aff9a696cb0b281a736e66007a4087923d7abab2
Stats:     4 lines in 2 files changed: 0 ins; 3 del; 1 mod

8283224: Remove THREAD_NOT_ALIVE from possible JDWP error codes

Reviewed-by: alanb, sspitsyn

-------------

PR: https://git.openjdk.org/jdk/pull/10189

Reply via email to