Пример #1
0
        /// <summary>
        /// 线程处理函数
        /// </summary>
        private void ThreadFuncWork(object[] data)
        {
            RECORD aObj         = null;
            int    iStatusIndex = (int)data[0];

            while (true)
            {
                if (m_ThreadShutdown[iStatusIndex])
                {
                    return;
                }
                try
                {
                    if (m_Queue.Count > 0)
                    {
                        aObj = (RECORD)m_Queue.Dequeue();
                    }
                }
                catch {}

                if (aObj == null)
                {
                    Thread.Sleep(1000);
                    continue;
                }

                aObj.Func(aObj.data);
                aObj = null;
            }
        }