mail-archives/mono-bugs/2009-February/085686.html

216 строки
4.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 473569] Deadlock when using NUnit + SWF + threads
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20473569%5D%20Deadlock%20when%20using%20NUnit%20%2B%20SWF%20%2B%20threads&In-Reply-To=bug-473569-28286%40https.bugzilla.novell.com/">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="085685.html">
<LINK REL="Next" HREF="085687.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 473569] Deadlock when using NUnit + SWF + threads</H1>
<B>bugzilla_noreply at novell.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20473569%5D%20Deadlock%20when%20using%20NUnit%20%2B%20SWF%20%2B%20threads&In-Reply-To=bug-473569-28286%40https.bugzilla.novell.com/"
TITLE="[Mono-bugs] [Bug 473569] Deadlock when using NUnit + SWF + threads">bugzilla_noreply at novell.com
</A><BR>
<I>Fri Feb 6 17:30:13 EST 2009</I>
<P><UL>
<LI>Previous message: <A HREF="085685.html">[Mono-bugs] [Bug 473569] Deadlock when using NUnit + SWF + threads
</A></li>
<LI>Next message: <A HREF="085687.html">[Mono-bugs] [Bug 473569] Deadlock when using NUnit + SWF + threads
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#85686">[ date ]</a>
<a href="thread.html#85686">[ thread ]</a>
<a href="subject.html#85686">[ subject ]</a>
<a href="author.html#85686">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE><A HREF="https://bugzilla.novell.com/show_bug.cgi?id=473569">https://bugzilla.novell.com/show_bug.cgi?id=473569</A>
User <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">aaragoneses at novell.com</A> added comment
<A HREF="https://bugzilla.novell.com/show_bug.cgi?id=473569#c2">https://bugzilla.novell.com/show_bug.cgi?id=473569#c2</A>
--- Comment #2 from Andr&#233;s G. Aragoneses &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">aaragoneses at novell.com</A>&gt; 2009-02-06 15:30:13 MST ---
This code is less risky (because it gives more time to ShowDialog to execute
until it gets blocked) but generates a worst hang (and in MS.NET it works):
using System;
using SWF = System.Windows.Forms;
using NUnit.Framework;
using System.Threading;
namespace UiaAtkBridgeTest
{
[TestFixture]
public class DialogTester
{
[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
{
Thread.Sleep(3000);
dialog.Dispose();
th.Abort();
}
}
private void Show()
{
dialog.ShowDialog();
}
}
}
}
--
Configure bugmail: <A HREF="https://bugzilla.novell.com/userprefs.cgi?tab=email">https://bugzilla.novell.com/userprefs.cgi?tab=email</A>
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="085685.html">[Mono-bugs] [Bug 473569] Deadlock when using NUnit + SWF + threads
</A></li>
<LI>Next message: <A HREF="085687.html">[Mono-bugs] [Bug 473569] Deadlock when using NUnit + SWF + threads
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#85686">[ date ]</a>
<a href="thread.html#85686">[ thread ]</a>
<a href="subject.html#85686">[ subject ]</a>
<a href="author.html#85686">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
mailing list</a><br>
</body></html>