RFR: 8302822: Method/Field/Constructor/RecordComponent::getGenericInfo() is not thread safe
Claes Redestad
redestad at openjdk.org
Mon Feb 20 08:50:24 UTC 2023
On Sun, 19 Feb 2023 18:41:18 GMT, liach <duke at openjdk.org> wrote:
> 8302822: Method/Field/Constructor/RecordComponent::getGenericInfo() is not thread safe
I think of this pattern of reading a to-be-lazily-initialized value into a local as simple hygiene, `volatile` or not. The code might seem solid without it - but stranger things than eliding a field load has happened. Storing into the local variable removes some doubt about how this code will be executed.
-------------
PR: https://git.openjdk.org/jdk/pull/12643
More information about the core-libs-dev
mailing list