private static readonly object locker = new object();
private volatile static HomeService instance = null;
public static HomeService Instance {
get {
if (instance == null)
{
lock (locker)
{
if (instance == null)
{
HomeService tmp = new HomeService();
System.Threading.Thread.MemoryBarrier();
instance = tmp;
}
}
}
return instance;
}
}

1962

被折叠的 条评论
为什么被折叠?



