[runtime] Synthesize IList and IReadOnlyList for the element type of enum errays...
[mono.git] / mono / tests / dynamic-method-resurrection.cs
index bd7bc5f315b0b8ca57474638b18bceee74fc9846..2715dd4432657a9b5eed946018ed9be347f6fa31 100644 (file)
@@ -3,6 +3,7 @@ using System.Reflection;
 using System.Reflection.Emit;
 using System.Runtime.InteropServices;
 using System.Runtime.CompilerServices;
+using System.Threading;
 
 delegate int Getter ();
 
@@ -17,6 +18,7 @@ class Host {
        }
 
        ~Host () {
+               Console.WriteLine ("got finalizated");
                Program.resed = g;
        }
 }
@@ -49,15 +51,19 @@ class Program {
                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;
                }
 }