On Sat, 2 Dec 2023 09:07:38 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:

> That code does not look like double-checked lock, it is something different. 
> It checks/init/sets one field and then returns another one. Even if both will 
> be marked as volatile the method may return null, since the loadedImage is 
> set to true before init of image.

I think the field `loadedImage` still needs to be volatile as it is accessed 
multiple time even though it can be argued to be non-DCL in classical way

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

PR Comment: https://git.openjdk.org/jdk/pull/16917#issuecomment-1837921065

Reply via email to