On Thu, 16 Jan 2025 22:39:48 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:

>> The test lacks a synchronization, so it is added by this fix.
>> 
>> Testing:
>>  - Ran the failing test `vmTestbase/nsk/jvmti/GetThreadCpuTime/thrcputime002`
>>  - TBD: submit mach5 tiers 1-5
>
> test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetThreadCpuTime/thrcputime002/thrcputime002.cpp
>  line 36:
> 
>> 34: 
>> 35: static jlong timeout = 0;
>> 36: static jrawMonitorID monitor;
> 
> Can you clarify which data this monitor is protecting? I think it is just 
> prevTestedThreadTime and prevAgentThreadTime, in which case I think you 
> should refine its usage. For example, is it really needed in any of the 
> callbacks other than callbackThreadStart()?

My intention is to serialize event callback calls plus protect multi-threaded 
access/modification of these variables.
I can add a comment with this clarification.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23144#discussion_r1919452824

Reply via email to