单例模式之双重校验锁
摘要:public class SingletonDoubleKey { /** * 加volatile得原因:内存模型允许所谓的“无序写入” * singletonDoubleKey = new SingletonDoubleKey(); * 该语句非原子操作,实际是三个步骤。 * 1.给singlet
阅读全文
posted @ 2021-02-23 16:57
posted @ 2021-02-23 16:57