摘要: 懒汉模式:在使用时候才创建出对象 在多线程时,会出现安全问题 class Test{ 2 public: 3 static Test* getInstance{ 4 if(m_test==NULL){ 5 m_test=new Test(); 6 } 7 return m_test; 8 } 9 p 阅读全文
posted @ 2024-05-08 14:48 iu本u 阅读(17) 评论(0) 推荐(0)