Beispiel #1
0
        private static void GetData()
        {
            int prevID = 0;

            while (true)
            {
                TestData result = switchQueue.Dequeue();
                if (result != null)
                {
                    Console.WriteLine(string.Format("Get {0} from {1}", result.ID, Thread.CurrentThread.Name));
                    //System.Diagnostics.Debug.Assert(result.ID == (prevID + 1));
                    prevID = result.ID;
                }
                else
                {
                    Thread.Sleep(100);
                }
            }
        }