7 Feb
2023
7 Feb
'23
2:12 a.m.
On Mon, 6 Feb 2023 09:40:00 GMT, Markus Grönlund <mgronlun@openjdk.org> wrote:
It will? Don't you still have the problem that the thread can be seen after ` thread->set_done_attaching_via_jni();` but before `post_thread_start_event(thread);` where the id will be set?
Yes. The JFR_JVM_THREAD_ID(thread) is a lazy assignment of the thread id. It can be done by the thread itself, or the periodic task thread. The premise for a JavaThread is that there exist a threadObj.
Now I get it. The zero thread id only arises when the `threadObj` is null and that is no longer possible when we skip JNI-attaching threads. ------------- PR: https://git.openjdk.org/jdk/pull/12388