There were a double check issue in 1.4
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
Were it fixed in later JDKs?
There were a double check issue in 1.4 http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html Were it fixed in later
Share
No, it wasn’t fixed and won’t be fixed. Java 5 just made it clearly specified that this idiom is broken and that is the final verdict. The proper way to lazily initialize an instance field involves another, similarly called idiom: the double-check idiom:
Reference: Josh Bloch, Effective Java. See also this Oracle technetwork interview with Josh Bloch.