Пример #1
0
 private void Insert(SListNode node)
 {
     bool success;
     do
     {
         node.Next = _headNode;
         success = Interlocked.CompareExchange(ref _headNode, node, node.Next) == node.Next;
     } while (!success);
 }
Пример #2
0
 public SList()
 {
     var tail = new SListNode();
     tail.Next = tail;
     _headNode = tail;
 }