[interp] disable some tests that fail on CI only
[mono.git] / mono / tests / threadpool-exceptions4.cs
index 17fa29e6dfb31fcaac3cd870a4a3b8b23c8c93fc..58b3a4ac2f5c3c7db2a459aa63384dcbc686d1d9 100644 (file)
@@ -2,13 +2,19 @@ using System;
 using System.Threading;
 
 class Test {
+       static object monitor;
+
        static int Main ()
        {
+               monitor = new object ();
                AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
                WaitCallback wcb = new WaitCallback ((a) => {
                        throw new Exception ("From the threadpoool");
                });
                wcb.BeginInvoke (wcb, OnCBFinished, null);
+               lock (monitor) {
+                       Monitor.Wait (monitor);
+               }
                Thread.Sleep (1000);
                return 1;
        }
@@ -20,6 +26,9 @@ class Test {
 
        static void OnUnhandledException (object sender, UnhandledExceptionEventArgs e)
        {
+               lock (monitor) {
+                       Monitor.Pulse (monitor);
+               }
                Environment.Exit (0);
        }
 }