2010-01-04 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / tests / main-returns-abort-resetabort.cs
blob38aac7ec6e8261039bb59dca98684734551705cb
2 using System;
3 using System.Threading;
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");
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");
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");
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");
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");
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");