double check locking without volatile (but with VarHandle release/acquire)
问题 The question is rather easy, in a way. Suppose I have this class: static class Singleton { } And I want to provide a singleton factory for it. I can do the (probably) obvious. I am not going to mention the enum possibility or any other, as they are of no interest to me. static final class SingletonFactory { private static volatile Singleton singleton; public static Singleton getSingleton() { if (singleton == null) { // volatile read synchronized (SingletonFactory.class) { if (singleton ==