Пример #1
0
        private static void PushAndGet(LIFO stack)
        {
            for (int i = 0; i < stack.Length; i++)
            {
                stack.Push(i);
                //stack.Get();
                Console.WriteLine("fdscdsvdsvsdvs");
            }

            Console.WriteLine("finish");
        }
Пример #2
0
        static void Main(string[] args)
        {
            var stack = new LIFO(10);

            for (int i = 0; i < 10; i++)
            {
                Task.Run(() =>
                {
                    PushAndGet(stack);
                });
            }
            Thread.Sleep(1500);
            Console.WriteLine(stack.Count());

            Console.ReadLine();
        }