예제 #1
0
        public T Dequeue()
        {
            lock (innerList)
            {
                T value = default(T);

                if (!IsEmpty())
                {
                    value = innerList.getByIndex(0);
                    innerList.removeByIndex(0);
                    DecreaseSize();
                }
                return(value);
            }
        }
예제 #2
0
        public T Peek()
        {
            T value = default(T);

            lock (innerList)
            {
                if (!IsEmpty())
                {
                    value = innerList.getByIndex(0);
                }
            }
            return(value);
        }