RFR: 8261921: ClassListParser::current should be used only by main thread [v2]
Ioi Lam
iklam at openjdk.java.net
Mon Feb 22 23:59:03 UTC 2021
On Fri, 19 Feb 2021 02:38:38 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> src/hotspot/share/classfile/classListParser.hpp line 86:
>>
>>> 84: };
>>> 85:
>>> 86: static Thread* _parsing_thread; // the thread that created _instance
>>
>> I forget whether we still want to use `volatile` here or not.
>
> _parsing_thread and _instance are read by another thread so that's why they have Atomic::load and store. This should be volatile if they need that level of memory ordering.
I've changed it to volatile.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2619
More information about the hotspot-runtime-dev
mailing list