public static void Enqueue(PackData _t)
 {
     lock (queue)
     {
         queue.Enqueue(_t);
     }
 }
Exemple #2
0
        void Fun_Toggle_First()
        {
            PackData _packet;
            int      _rr = 0;

            for (int i = 0; i < Constant.LOOP_MAX; i++)
            {
                int _count = list.Count;
                int _rand  = _rr++ % 2;
                if (_rand == 0)
                {
                    _packet = new PackData();
                    _packet.PlusCount();
                    list.Add(_packet);
                }
                else if (_count > 0)
                {
                    list.RemoveAt(0);
                }
            }
        }
Exemple #3
0
        void Fun_Random_End()
        {
            PackData _packet;
            Random   _random = new Random();

            for (int i = 0; i < Constant.LOOP_MAX; i++)
            {
                int _count = list.Count;
                int _rand  = _random.Next() % 2;
                if (_rand == 0)
                {
                    _packet = new PackData();
                    _packet.PlusCount();
                    list.Add(_packet);
                }
                else if (_count > 0)
                {
                    list.RemoveAt(_count - 1);
                }
            }
        }