[System.ServiceModel] Prevent crash in Dispatcher.ListenerLoopManager… (#7136)
[mono-project.git] / mono / tests / main-returns-background-resetabort.cs
blob127f1e50456a965ddcdca889e7998747b61fa689
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.IsBackground=true;
9 thr.Start();
10 Thread.Sleep(1200);
11 Console.WriteLine("Main thread returns");
14 public static void thread() {
15 try {
16 Console.WriteLine("Thread running");
17 Thread.Sleep(500);
18 } catch(ThreadAbortException) {
19 Thread.ResetAbort();
20 Console.WriteLine("Abort reset!");
21 } finally {
22 Console.WriteLine("ThreadAbortException finally");
24 try {
25 Console.WriteLine("Thread running");
26 Thread.Sleep(500);
27 } catch(ThreadAbortException) {
28 Thread.ResetAbort();
29 Console.WriteLine("Abort reset!");
30 } finally {
31 Console.WriteLine("ThreadAbortException finally");
33 try {
34 Console.WriteLine("Thread running");
35 Thread.Sleep(500);
36 } catch(ThreadAbortException) {
37 Thread.ResetAbort();
38 Console.WriteLine("Abort reset!");
39 } finally {
40 Console.WriteLine("ThreadAbortException finally");
42 try {
43 Console.WriteLine("Thread running");
44 Thread.Sleep(500);
45 } catch(ThreadAbortException) {
46 Thread.ResetAbort();
47 Console.WriteLine("Abort reset!");
48 } finally {
49 Console.WriteLine("ThreadAbortException finally");
51 try {
52 Console.WriteLine("Thread running");
53 } catch(ThreadAbortException) {
54 Thread.ResetAbort();
55 Console.WriteLine("Abort reset!");
56 } finally {
57 Console.WriteLine("ThreadAbortException finally");