RFR: 8320652: ThreadInfo.isInNative needs to be updated to say what executing native code means
Mandy Chung
mchung at openjdk.org
Mon Nov 27 20:16:08 UTC 2023
On Thu, 23 Nov 2023 10:25:31 GMT, Alan Bateman <alanb at openjdk.org> wrote:
> This is a docs only change to j.l.management.ThreadInfo::isInNative.
>
> The method currently specifies that it tests if the thread is "executing native code via the Java Native Interface (JNI)". It would be clearer to say that it tests if the thread is executing a native method, and expand it to include native code invoked using the new foreign linker APIs. For now, I've left out the detail of a downcall handle created with the "critical" linker option.
>
> The existing javadoc has wording to try to clarify that "native code" does not include runtime or compiled code. I went through a few iterations to work this in but all attempts just invite more questions and nit picking. To keep it simple, this sentence is dropped so that the method description is focused on the cases where the method returns true.
It's ok to drop the sentence about "native code" does not include runtime or compiled code.
I can see why you left out the detail of a downcall handle. Maybe better to link the text "method handle" to `Linker::downcallHandle` that is how such a method handle is created.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16791#issuecomment-1828467569
More information about the serviceability-dev
mailing list