[2020-02] Avoid following invalid pointers in mono_w32process_get_modules on Darwin...
[mono-project.git] / mono / tests / threadpool-in-processexit.cs
blob430039687ab862e48d1c835b5c3f5c3c8fd1499e
1 using System;
2 using System.Threading;
4 class Program
6 static AutoResetEvent mre = new AutoResetEvent(false);
8 static void Main ()
10 AppDomain.CurrentDomain.ProcessExit += SomeEndOfProcessAction;
13 static void SomeEndOfProcessAction(object sender, EventArgs args)
15 ThreadPool.QueueUserWorkItem (new WaitCallback (ThreadPoolCallback));
16 if (mre.WaitOne(1000))
17 Console.WriteLine ("PASS");
18 else
19 Console.WriteLine ("FAIL");
22 static void ThreadPoolCallback (object state)
24 mre.Set ();