On Mon, 27 Apr 2026 22:10:15 GMT, Leonid Mesnik <[email protected]> wrote:

>> David Holmes has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Use std::atomic for shared variables
>
> test/hotspot/jtreg/runtime/jni/critical/libSuspendInCritical.cpp line 34:
> 
>> 32: static jvmtiEnv* jvmti = nullptr;
>> 33: 
>> 34: volatile static jboolean stay_in_critical_native = JNI_TRUE;
> 
> The `stay_in_critical_native` and `native_counter` should be std::atomic and 
> not volatile for mutli-threading correctness in C++.

Thanks for looking at this Leonid @lmesnik ! I'd forgotten that we had started 
to use std::atomic in the C++ tests.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30936#discussion_r3151930500

Reply via email to