public static LazyDoubleCheckSingleton getInstrance(){
if(lazyDoubleCheckSingleton == null){
synchronized (LazyDoubleCheckSingleton.class){
if(lazyDoubleCheckSingleton == null){
lazyDoubleCheckSingleton = new LazyDoubleCheckSingleton();
}
}
}
return lazyDoubleCheckSingleton;
}
在DoubleCheck的写法中new LazyDoubleCheckSingleton()时不会有初始化锁吗?
这个感觉像是类的初始化啊,如果此处没有初始化锁,为什么没有呢?
求不笑-.-