Bump API snapshot submodule
[mono.git] / mcs / tests / test-iter-23.cs
index cf1b181359111ffbc14a818e673130866fa39d1d..3dd524c4960c0d054ec1f4926142cfc454ee98c6 100644 (file)
@@ -5,6 +5,7 @@ using System.Threading;
 class X
 {
        static ManualResetEvent dispose = new ManualResetEvent (false);
+       static ManualResetEvent wait = new ManualResetEvent (false);
 
        static IEnumerable GetIt2 ()
        {
@@ -15,7 +16,7 @@ class X
        static int Delay ()
        {
                dispose.Set ();
-               Thread.Sleep (10);
+               wait.WaitOne ();
                return 1;
        }
 
@@ -25,6 +26,7 @@ class X
                ThreadPool.QueueUserWorkItem (l => {
                        dispose.WaitOne ();
                        ((IDisposable) e).Dispose ();
+                       wait.Set ();
                });
 
                if (!e.MoveNext ())