/// <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(); } } }
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(); } } }