示例#1
0
        /// <summary>
        /// 获取单例
        /// </summary>
        /// <returns></returns>
        public static WcfServer GetInstance()
        {
            if (instance == null)
            {
                lock (lockhelper)
                {
                    if (instance == null)
                    {
                        instance = new WcfServer();
                    }
                }
            }

            return instance;
        }
示例#2
0
 //释放单例
 private void ReleaseInstance()
 {
     if (instance != null)
     {
         lock (lockhelper)
         {
             if (instance != null)
             {
                 instance = null;
             }
         }
     }
 }