RFR: 8364819: Post-integration cleanups for JDK-8359820 [v3]

Aleksey Shipilev shade at openjdk.org
Wed Aug 6 15:04:04 UTC 2025


On Wed, 6 Aug 2025 14:18:48 GMT, Anton Artemov <duke at openjdk.org> wrote:

>> src/hotspot/share/utilities/vmError.hpp line 229:
>> 
>>> 227:   static void set_safepoint_timed_out_thread(Thread* thread);
>>> 228:   static volatile Thread* get_handshake_timed_out_thread();
>>> 229:   static volatile Thread* get_safepoint_timed_out_thread();
>> 
>> `static volatile` for method declarations makes no real  sense? Just `static` would suffice.
>
> If the variable is declared volatile, the same should be done with the getter, otherwise GCC complains about conversion:
> 
> error: invalid conversion from 'volatile Thread*' to 'Thread*'

Oh, that's because you probably want the:


static Thread* volatile _handshake_timed_out_thread;


...not:


static volatile Thread* _handshake_timed_out_thread;


I.e. the volatility is about the _field_, not about the _type_.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26656#discussion_r2257487900


More information about the hotspot-dev mailing list