4
using System.Threading;
6
internal class AtomicReferenceArray<T> where T : class
10
public AtomicReferenceArray (int size)
12
this.array = new T[size];
15
public bool CompareAndSet (int slot, T expect, T update)
17
return (Interlocked.CompareExchange<T> (ref array[slot], update, expect) == expect);