復制代碼 代碼如下:
private static volatile T _instance = null;
private static object objLock = new Object();
private T()
{
}
public static T Instance
{
get
{
if (_instance == null)
{
lock (objLock)
{
if (_instance == null)
{
_instance = new T();
}
}
}
return _instance;
}
}
復制代碼 代碼如下:
public static void RefreshInstance()
{
_instance = new T();
}
新聞熱點
疑難解答
圖片精選