摘要: 设计模式汇总 1.双重锁单例模式 单例模式的应用:双重检查所机制DCL(double check lock) public class Test{ //为什么要用volatile关键字:因为在第一次初始化时,走到instance = new Test();时,进来N个线程,有了volatile就可以 阅读全文
posted @ 2021-04-24 21:36 chxLonely 阅读(38) 评论(0) 推荐(0) 编辑