Exemplo n.º 1
0
            internal AtPopEnumerator(LLStack <T> stack)
            {
                SinglyLinkedNode <T> node = stack._head.Next;

                for (;;)
                {
                    SinglyLinkedNode <T> oldNext = Interlocked.CompareExchange(ref stack._head.Next, null, node);
                    if (oldNext == node)
                    {
                        _node.Next = node;
                        return;
                    }
                    node = oldNext;
                }
            }
Exemplo n.º 2
0
 internal Enumerator(LLStack <T> stack)
 {
     _node = (_stack = stack)._head;
 }
Exemplo n.º 3
0
 internal PopEnumerator(LLStack <T> stack)
 {
     _stack = stack;
 }