Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / threadpool-in-processexit.cs
1 using System;
2 using System.Threading;
3
4 class Program
5 {
6         static AutoResetEvent mre = new AutoResetEvent(false);
7
8         static void Main ()
9         {
10                 AppDomain.CurrentDomain.ProcessExit += SomeEndOfProcessAction;
11         }
12
13         static void SomeEndOfProcessAction(object sender, EventArgs args)
14         {
15                 ThreadPool.QueueUserWorkItem (new WaitCallback (ThreadPoolCallback));
16                 if (mre.WaitOne(1000))
17                         Console.WriteLine ("PASS");
18                 else
19                         Console.WriteLine ("FAIL");
20         }
21
22         static void ThreadPoolCallback (object state)
23         {
24                 mre.Set ();
25         }
26 }