On Wed, 29 Mar 2023 21:44:56 GMT, Patricio Chilano Mateo 
<pchilanom...@openjdk.org> wrote:

>> Serguei Spitsyn has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   review: updated correction of jt->jvmti_thread_state() links in 
>> VM_SetNotifyJvmtiEventsMode
>
> test/hotspot/jtreg/serviceability/jvmti/vthread/ToggleNotifyJvmtiTest/ToggleNotifyJvmtiTest.java
>  line 142:
> 
>> 140:                 TestedThread thread = threads[i];
>> 141:                 if (thread == null) {
>> 142:                     break;
> 
> Bailing out here means we could later disable the flag while there are 
> virtual threads running. If I comment out the first two sleeps in the main 
> thread I can see that issue happening. To avoid relying on timing I suggest 
> using a semaphore to wait at the beginning of finishThreads(), and signal at 
> the end of startThreads().

Good comment, thanks.
I made `startThreads()` method to be synchronized instead of `startThread()`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13133#discussion_r1152656758

Reply via email to