Esempio n. 1
0
        /// <summary>
        /// Executing any work items on the Run method means executing them on the STA thread.
        /// </summary>
        private void Run()
        {
            while (true)
            {
                bool stop = mStopEvent.WaitOne(0);
                if (stop)
                {
                    break;
                }

                SendOrPostCallbackItem workItem = mFilumPunter.Peek();
                if (workItem != null)
                {
                    workItem.Execute();
                }
            }
        }
Esempio n. 2
0
        private void Run()
        {
            mThreadID = Thread.CurrentThread.ManagedThreadId;
            while (true)
            {
                bool stop = mStopEvent.WaitOne(0);
                if (stop)
                {
                    break;
                }

                SendOrPostCallbackItem workItem = mQueueConsumer.Dequeue();
                if (workItem != null)
                {
                    workItem.Execute();
                }
            }
        }