+2007-01-09 Robert Jordan <robertj@gmx.net>
+
+ * bug-80392.2.cs: Add test for bug #80392.
+
2007-01-09 Robert Jordan <robertj@gmx.net>
* cross-domain.cs: Reflect marshal.c changes: after r70643
--- /dev/null
+using System;
+using System.Threading;
+using System.Runtime.InteropServices;
+
+class Test {
+ delegate int SimpleDelegate (int a);
+
+ static int Method (int a) {
+ return a;
+ }
+
+ static void Callback (IAsyncResult ar)
+ {
+ }
+
+ static int Main () {
+ SimpleDelegate d1 = new SimpleDelegate (Method);
+ SimpleDelegate d2 = new SimpleDelegate (Method);
+
+ AsyncCallback ac = new AsyncCallback (Callback);
+
+ IAsyncResult ar1 = d1.BeginInvoke (1, ac, null);
+ IAsyncResult ar2 = d2.BeginInvoke (2, ac, null);
+
+ try {
+ d1.EndInvoke (ar2);
+ return 1;
+ } catch (InvalidOperationException) {
+ // expected
+ }
+
+ try {
+ d2.EndInvoke (ar1);
+ return 2;
+ } catch (InvalidOperationException) {
+ // expected
+ }
+
+ d1.EndInvoke (ar1);
+ d2.EndInvoke (ar2);
+
+ return 0;
+ }
+}