using System.Reflection.Emit;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
+using System.Threading;
delegate int Getter ();
}
~Host () {
+ Console.WriteLine ("got finalizated");
Program.resed = g;
}
}
public static int Main ()
{
int cnt = 5;
- DoStuff ();
+ var t = new Thread (DoStuff);
+ t.Start ();
+ t.Join ();
do {
if (CheckStuff ())
break;
GC.Collect ();
GC.WaitForPendingFinalizers ();
+ Thread.Sleep (10);
} while (cnt-- > 0);
GC.Collect ();
GC.WaitForPendingFinalizers ();
+ Console.WriteLine ("done with finalizers");
return result == 42 ? 0 : 1;
}
}