Пример #1
0
        public static FruitStore GetInstance()
        {
            //多线程下使用
            //if (fsInstance==null)
            //{

            //lock (_lock)
            //{
            if (fsInstance == null)
            {
                fsInstance = new FruitStore();
            }
            //}
            //}
            return(fsInstance);
        }
Пример #2
0
 public void Execute()
 {
     FruitStore.GetInstance().ListOfFruits();
 }