https://bugzilla.novell.com/show_bug.cgi?id=347676


           Summary: Mono does not exit if main thread returns, then other
                    thread calls System.Environment.Exit
           Product: Mono: Runtime
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [EMAIL PROTECTED]
          Found By: ---


Mono hangs running this program:

using System;
using System.Threading;

class FibThread {
    static long fib (long n) {
        if (n < 2)
            return n;
        else
            return fib (n - 1) + fib (n - 2);
    }

    public void work () {
        for (long i = 0; i < 30; ++i)
            Console.WriteLine (fib (i).ToString ());
        Console.WriteLine ("exiting");
        System.Environment.Exit (0);
    }
}

public class Test {
    public static Thread newThread () {
        FibThread ft = new FibThread ();
        return new Thread (new ThreadStart (ft.work));
    }

    static int Main () {
        Thread t = newThread ();
        t.Start ();
        Console.WriteLine ("started");
        return 0;
    }
}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to