Пример #1
0
        public void EndDequeue()
        {
            if (isDequeueing)
            {
                lock (queueLock)
                {
                    queue.Dequeue();

                    isDequeueing = false;
                }
            }
        }
Пример #2
0
        public T BeginDequeue()
        {
            if (!isDequeueing)
            {
                lock (queueLock)
                {
                    if (queue.Count > 0)
                    {
                        isDequeueing = true;

                        return(queue.Peek());
                    }
                }
            }

            return(null);
        }
Пример #3
0
 public void CancelDequeue()
 {
     isDequeueing = false;
 }