[2020-02] Avoid following invalid pointers in mono_w32process_get_modules on Darwin...
[mono-project.git] / mono / tests / subthread-exit.cs
blobe8ff684a05110090759f84fdddbb48ff5e20f65c
2 using System;
3 using System.Threading;
5 public class foo {
6 public static int Main() {
7 Thread thr=new Thread(new ThreadStart(foo.thread));
8 thr.Start();
9 Thread.Sleep(1200);
10 Console.WriteLine("Main thread returns");
11 // the subthread calls Exit(0) before we reach here
12 return 1;
15 public static void thread() {
16 Console.WriteLine("Thread running");
17 Thread.Sleep(500);
18 Console.WriteLine("Thread exiting");
19 Environment.Exit(0);