Ejemplo n.º 1
0
 private void Grow(int newCapacity)
 {
     T[] oldItems = Items;
     T[] items    = new T[Math.Max(newCapacity, 31)];
     Array.Copy(oldItems, 0, items, 0, oldItems.Length);
     Concurrency.LockFreeUpdate(ref Items, items);
 }
Ejemplo n.º 2
0
        public void Clear()
        {
            Count = 0;
            T[] items = new T[31];
            Concurrency.LockFreeUpdate(ref Items, items);

            //for (int i = 0, count = Count; i < count; i++)
            //	Items [i] = null;
            //Count = 0;
        }
Ejemplo n.º 3
0
        // *** Adding Items ***

        public void AddFirst(T value)
        {
            Node node = new Node(value);

            node.Next = Head;
            Concurrency.LockFreeUpdate(ref m_Head, node);
            if (Current == null)
            {
                Current = node;
            }
            Count++;
            OnInsert(value);
        }