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

            return instance;
        }
Exemplo n.º 2
0
 //释放单例
 private void ReleaseInstance()
 {
     if (instance != null)
     {
         lock (lockhelper)
         {
             if (instance != null)
             {
                 instance = null;
             }
         }
     }
 }