//释放单例 private void ReleaseInstance() { if (instance != null) { lock (lockhelper) { if (instance != null) { instance = null; } } } }
/// <summary> /// 获取单例 /// </summary> /// <returns></returns> public static WcfServer GetInstance() { if (instance == null) { lock (lockhelper) { if (instance == null) { instance = new WcfServer(); } } } return instance; }