RFR: 8319925: CSS.BackgroundImage incorrectly uses double-checked locking

Prasanta Sadhukhan psadhukhan at openjdk.org
Mon Dec 4 06:32:37 UTC 2023


On Sat, 2 Dec 2023 09:07:38 GMT, Sergey Bylokhov <serb at 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


More information about the client-libs-dev mailing list