On Fri, 1 Dec 2023 06:31:00 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> 
wrote:

> CSS.BackgroundImage.getImage uses double-checked locking but the loadedImage 
> field isn't declared as volatile. Without the volatile modifier, 
> double-checked locking implementation is broken.

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.

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

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

Reply via email to