public void Enqueue(ProcessingItem item)
 {
     lock (_monitor)
     {
         _queue.Enqueue(item);
         Monitor.Pulse(_monitor);
     }
 }
        private void OnProcessingThread()
        {
            while (_continueProcessing)
            {
                ProcessingItem item = null;

                lock (_monitor)
                {
                    while (!_queue.TryDequeue(out item) && _continueProcessing)
                    {
                        Monitor.Wait(_monitor);
                    }
                }

                if (item != null)
                {
                    item.Process();
                }
            }
        }