标签:
class LogUtil{
public static LogUtil getInstance() { if (sLogUtil == null) { synchronized (LogUtil.class) { if (sLogUtil == null) { sLogUtil = new LogUtil(); } } } return sLogUtil; }
}
加双重同步锁,防止多线实例化
标签:
原文地址:http://www.cnblogs.com/maliu/p/5260291.html