[Mono-bugs] [Bug 473569] New: Deadlock when using NUnit + SWF + threads

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Feb 6 17:09:47 EST 2009


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


           Summary: Deadlock when using NUnit + SWF + threads
    Classification: Mono
           Product: Mono: Runtime
           Version: SVN
          Platform: x86
        OS/Version: openSUSE 11.0
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: aaragoneses at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


The following piece of code, when run in Mono 2.4, shows the NUnit results, but
hangs:

using System;
using SWF = System.Windows.Forms;

using NUnit.Framework;
using System.Threading;

namespace UiaAtkBridgeTest
{


    [TestFixture]
    public class BDialogTester
    {

        [Test]
        public void OpenFileDialog()
        {
            TestDialog(new SWF.OpenFileDialog());
        }

        static void TestDialog(SWF.CommonDialog dialog)
        {
            new DialogTester(dialog).Test();
        }

        public class DialogTester
        {
            SWF.CommonDialog dialog;
            Thread th;

            internal DialogTester(SWF.CommonDialog dialog)
            {
                this.dialog = dialog;
            }

            internal void Test()
            {
                th = new Thread(new ThreadStart(Show));
                th.SetApartmentState(ApartmentState.STA);
                try
                {
                    th.Start();
                }
                finally
                {
                    new Thread(new ThreadStart(Dispose)).Start ();
                }
            }

            private void Dispose()
            {
                dialog.Dispose();
                th.Abort();
            }

            private void Show()
            {
                dialog.ShowDialog();
            }
        }
    }
}


In MS.NET it works.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list