On Mon, 20 Nov 2023 19:28:13 GMT, Jiangli Zhou <jian...@openjdk.org> wrote:

>> Please review JvmtiThreadState::state_for_while_locked change to handle the 
>> state->get_thread_oop() null case. Please see 
>> https://bugs.openjdk.org/browse/JDK-8319935 for details.
>
> Jiangli Zhou has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Add a check for a thread is_attaching_via_jni, based on David Holmes' 
> comment.

src/hotspot/share/prims/jvmtiExport.cpp line 3144:

> 3142:   // If the current thread is attaching from native and its thread oop 
> is being
> 3143:   // allocated, things are not ready for allocation sampling.
> 3144:   if (thread->is_Java_thread()) {

Nit: There is no need for this check at line 3144.
There was already check for `!thread->is_Java_thread()` and return with false 
at line 3138:

  if (!thread->is_Java_thread() || thread->is_Compiler_thread()) {
    return false;
  }

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16642#discussion_r1401302311

Reply via email to