internal virtual bool CasNext(Node cmp, Node val)
{
// .NET port: Interlocked.CompareExchange(location, value, comparand) is backwards from
// AtomicReferenceFieldUpdater.compareAndSet(obj, expect, update), so swapping val and cmp.
// Also, it doesn't return bool if it was updated, so we need to compare to see if
// original == comparand to determine whether to return true or false here.
Node original = Next;
return ReferenceEquals(Interlocked.CompareExchange(ref Next, val, cmp), original);
}
}