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; } }
internal Enumerator(LLStack <T> stack) { _node = (_stack = stack)._head; }
internal PopEnumerator(LLStack <T> stack) { _stack = stack; }