3 using System.Runtime.CompilerServices;
4 using System.Threading;
8 public static void Main ()
10 bool finished = false;
13 Thread t1 = new Thread (() => {
17 Thread t2 = new Thread (() => {
19 int local_can_gc = can_gc;
20 if (local_can_gc > 0 && Interlocked.CompareExchange (ref can_gc, local_can_gc - 1, local_can_gc) == local_can_gc)
31 for (int i = 0; i < 50 * 40 * 5; ++i) {
33 Interlocked.Increment (ref can_gc);
36 if ((i + 1) % (50) == 0)
38 if ((i + 1) % (50 * 40) == 0)