diff options
author | Marek Safar <masafa@microsoft.com> | 2016-08-11 10:54:55 +0300 |
---|---|---|
committer | Marek Safar <masafa@microsoft.com> | 2016-08-11 10:55:23 +0300 |
commit | a00de00d95ecdfbb242ad05fd72cee605f717f5a (patch) | |
tree | 08121c4fdb2f4865b0ca1762a87d1ee5020e19de /mcs/tests/test-iter-23.cs | |
parent | d22f93ffa66b1ba35d895fd8f627fa9ac7ad6e9e (diff) |
[mcs] More reliable tests
Diffstat (limited to 'mcs/tests/test-iter-23.cs')
-rw-r--r-- | mcs/tests/test-iter-23.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mcs/tests/test-iter-23.cs b/mcs/tests/test-iter-23.cs index cf1b1813591..3dd524c4960 100644 --- a/mcs/tests/test-iter-23.cs +++ b/mcs/tests/test-iter-23.cs @@ -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 ()) |