On Mon, 11 May 2026 23:12:05 GMT, Chris Plummer <[email protected]> wrote:
>> Please review following test fix that improve synchronization of compiled >> method load/unload events. >> >> The CompiledMethodLoad/CompiledMethodUnload might be already executing while >> SetEventCallbacks removed their callbacks. >> Thus they hit 'newEventCount' after setting it to zero and cause test to >> fail. >> >> The simple monitor inside event doesn't help, because race might happen >> while callback is calling in VM or before it obtain lock. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t003/em02t003.cpp > line 480: > >> 478: return false; >> 479: >> 480: /* Give some time to complete already processing cbNew* events. */ > > cbNew* is confusing. I would just say "Give some time to complete events > already in progress." I wanted to focus that it is only needed when newEventCount are checked and correspnsing cbNewCompiledMethodLoad and cbNewCompiledMethodUnload events. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/31128#discussion_r3224060312
