On Thu, 16 Jan 2025 09:15:28 GMT, Serguei Spitsyn <sspit...@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()?

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

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

Reply via email to