2 using System.Threading;
4 public class InterlockTest
11 public static int Main() {
15 InterlockTest it = new InterlockTest ();
19 int c = Interlocked.Add (ref it.test, 1);
27 b = Interlocked.Add (ref a, 1);
35 int lc = Interlocked.Add (ref it.ltest, 1);
43 lb = Interlocked.Add (ref la, 1);
49 Console.WriteLine ("done!");