コード例 #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();
 }