2008年1月23日
摘要: publicsealedclassSingleton<T>whereT:new()...{privatestaticTinstance=newT();privatestaticobjectlockHelper=newobject();privateSingleton()...{}publicstaticTGetInstance()...{if(instance==null)...{lock(lockHelper)...{if(instance==null)...{instance=newT();}}}returninstance;}} 阅读全文
posted @ 2008-01-23 15:35 wkjs 阅读(132) 评论(0) 推荐(0) 编辑