예제 #1
0
        private void ProcessItems()
        {
            ExecutionEngine.EventLogger.Write("QueueProcessingThread:ProcessItems");
            try
            {
                while (IsCallerThreadAlive())
                {
                    while (!_isStopped)
                    {
                        IQueueItem currentItem = GetNextQueuedItem();

                        if (!_isStopped && currentItem != null && IsCallerThreadAlive())
                        {
                            currentItem.Process();
                        }
                        else
                        {
                            _isStopped = true;
                        }
                    }

                    _processStopped.Set();
                    _startGetting.WaitOne(WaitInterval, false);

                    ExecutionEngine.EventLogger.Write("QueueProcessingThread:ProcessItems:1");
                }
            }
            catch (Exception e)
            {
                ExecutionEngine.EventLogger.WriteExceptionInfo(e);
                throw;
            }

            ExecutionEngine.EventLogger.Write("QueueProcessingThread:ProcessItem:2");
        }