On Tue, 16 May 2023 20:42:34 GMT, Patricio Chilano Mateo 
<pchilanom...@openjdk.org> wrote:

>> src/hotspot/share/prims/jvmtiThreadState.cpp line 584:
>> 
>>> 582:       JvmtiExport::post_vthread_unmount(vthread);
>>> 583:     }
>>> 584:     VTMS_unmount_begin(vthread, /* last_unmount */ false);
>> 
>> I think it would be better just to add 
>> thread->rebind_to_jvmti_thread_state_of(thread->threadObj());
>> after this call instead of adding a parameter to  VTMS_unmount_begin.
>> Just suggestion.
>
> So we need to execute the 
> thread->rebind_to_jvmti_thread_state_of(thread->threadObj()) call after we do 
> the cleanup to avoid removing the wrong state. So the other option to avoid 
> the extra parameter would be to remove the rebind call from 
> VTMS_unmount_begin(), which I also thought. But that would require to also 
> add it to VTMS_vthread_unmount() for the normal unmount case, which already 
> breaks the symmetry of all those methods, given that for the mount case the 
> rebind call is encapsulated in VTMS_mount_end().

Thanks for the explanation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13949#discussion_r1195686141

Reply via email to