单例模式-- 多线程安全法

多线程,会有指令重排问题,造成 new 对象时候, 步骤不一致,用 volatile修饰可以。

原文地址:https://www.cnblogs.com/GotoJava/p/12584544.html