Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1.         public Node<T> NextNode
  2.         {
  3.             get { return _nextNode; }
  4.             set
  5.             {
  6.                 var r = new Random();
  7.                 Node<T> initialValue, computedValue;
  8.                 do
  9.                 {
  10.                     initialValue = _nextNode;
  11.                     computedValue = value;
  12.                 }
  13.                 while (initialValue != Interlocked.CompareExchange(ref _nextNode,
  14.                     computedValue, initialValue));
  15.             }
  16.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement