[runtime] Remove all NACL support. It was unmaintained for a long time. (#4955)
[mono.git] / mono / tests / main-returns-abort-resetabort.cs
1
2 using System;
3 using System.Threading;
4
5 public class foo {
6         public static void Main() {
7                 Thread thr=new Thread(new ThreadStart(foo.thread));
8                 thr.Start();
9                 Thread.Sleep(600);
10                 Console.WriteLine("Aborting child thread");
11                 thr.Abort();
12                 Console.WriteLine("Main thread returns");
13         }
14
15         public static void thread() {
16                 try {
17                         Console.WriteLine("Thread running");
18                         Thread.Sleep(500);
19                 } catch(ThreadAbortException) {
20                         Thread.ResetAbort();
21                         Console.WriteLine("Abort reset!");
22                 } finally {
23                         Console.WriteLine("ThreadAbortException finally");
24                 }
25                 try {
26                         Console.WriteLine("Thread running");
27                         Thread.Sleep(500);
28                 } catch(ThreadAbortException) {
29                         Thread.ResetAbort();
30                         Console.WriteLine("Abort reset!");
31                 } finally {
32                         Console.WriteLine("ThreadAbortException finally");
33                 }
34                 try {
35                         Console.WriteLine("Thread running");
36                         Thread.Sleep(500);
37                 } catch(ThreadAbortException) {
38                         Thread.ResetAbort();
39                         Console.WriteLine("Abort reset!");
40                 } finally {
41                         Console.WriteLine("ThreadAbortException finally");
42                 }
43                 try {
44                         Console.WriteLine("Thread running");
45                         Thread.Sleep(500);
46                 } catch(ThreadAbortException) {
47                         Thread.ResetAbort();
48                         Console.WriteLine("Abort reset!");
49                 } finally {
50                         Console.WriteLine("ThreadAbortException finally");
51                 }
52                 try {
53                         Console.WriteLine("Thread running");
54                 } catch(ThreadAbortException) {
55                         Thread.ResetAbort();
56                         Console.WriteLine("Abort reset!");
57                 } finally {
58                         Console.WriteLine("ThreadAbortException finally");
59                 }
60         }
61 }
62