On Tue, 9 Mar 2021 20:56:15 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
>> 8263138: Initialization of sun.font.SunFontManager.platformFontMap is not >> thread safe > > Marked as reviewed by aivanov (Reviewer). > I don't know why making this volatile is doing anything. > Let's discuss this further. It will prevent the possibility that one thread will store the non-null value to the SunFontManager.platformFontMap and only after that complete initialization of object stored in that field due to code optimizations. It is similar to the volatile DCL: see "broken multithreaded version" example: https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java ------------- PR: https://git.openjdk.java.net/jdk/pull/2762