On Tue, 1 Dec 2026 04:27:52 GMT, Leonid Mesnik <[email protected]> wrote:

>> During exit VM disable execution of new JVMTI events and waits for already 
>> started events before  changing jvmti phase to dead.  
>> 
>> Thus it exits from VM event then it block itself. The fix updates vm_death 
>> to wait only events on the other threads. 
>> 
>> 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Leonid Mesnik has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - typos fixed
>  - Updated test and comments.

Thank you for update. I've posted a couple of more nits.

src/hotspot/share/prims/jvmtiEventController.cpp line 1247:

> 1245:   const double max_wait_time = 60;
> 1246:   // The first time we see the callback count for other threads reach 
> zero we know all actual
> 1247:   // callbacks are complete. The count could rise again, but those 
> "callbacks"

Nit: "all actual callbacks are complete." => "all actual callbacks on other 
threads are complete."

src/hotspot/share/prims/jvmtiEventController.inline.hpp line 123:

> 121:   AtomicAccess::dec(&_in_callback_count);
> 122:   --_current_thread_in_callback_count;
> 123:   assert(_current_thread_in_callback_count >= 0, "Shouldn't be 
> negative");

Nit: You can move it before line 122. It will be simpler a little bit: 
`assert(_current_thread_in_callback_count > 0, "Shouldn't be negative");`

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

PR Review: https://git.openjdk.org/jdk/pull/34135#pullrequestreview-6125689778
PR Review Comment: https://git.openjdk.org/jdk/pull/34135#discussion_r4749763161
PR Review Comment: https://git.openjdk.org/jdk/pull/34135#discussion_r4749732456

Reply via email to