http://bugzilla.novell.com/show_bug.cgi?id=578243

http://bugzilla.novell.com/show_bug.cgi?id=578243#c2


--- Comment #2 from Mark Probst <[email protected]> 2010-04-08 12:56:46 UTC ---
This test case reproduces the bug every time:

using System;
using System.Threading;

class Test
{
    static object o = new object ();

    static void DoStuff ()
    {
    Console.WriteLine ("thread: started");
    lock (o) {
        Console.WriteLine ("thread: locked");
    }
    Console.WriteLine ("thread: still here");
    }

    static void Main ()
    {
    Thread t = new Thread (DoStuff);
    lock (o) {
        t.Start ();
        Thread.Sleep (1000);
        Console.WriteLine ("main: slept");
        t.Abort ();
        Console.WriteLine ("main: aborted");
    }
    Console.WriteLine ("main: unlocked");
    Thread.Sleep (1000);
    lock (o) {
        Console.WriteLine ("main: locked");
    }
    Console.WriteLine ("main: done");
    }
}

What seems to be going on here is that if a thread is aborted while it's
waiting for a lock, it proceeds to acquire that lock and then
mono_thread_execute_interruption() is called and throws the
ThreadAbortException, but the thread is not in a place where the finally
handler will be called.

-- 
Configure bugmail: http://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