[Mono-bugs] [Bug 56157][Nor] Changed - Exception calling Monitor.Exit twice

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 29 Mar 2004 07:43:06 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by lluis@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=56157

--- shadow/56157	2004-03-29 07:14:19.000000000 -0500
+++ shadow/56157.tmp.24561	2004-03-29 07:43:06.000000000 -0500
@@ -1,14 +1,14 @@
 Bug#: 56157
 Product: Mono: Runtime
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
-Status: NEW   
-Resolution: 
-Severity: 
+Status: RESOLVED   
+Resolution: FIXED
+Severity: Unknown
 Priority: Normal
 Component: misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: lluis@ximian.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -44,6 +44,36 @@
 		lock (t)
 		{
 			Monitor.Exit (t);
 		}
 
 that works on MS.NET but fails on Mono.
+
+------- Additional Comments From lluis@ximian.com  2004-03-29 07:43 -------
+It seems that MS.NET never checks the owner of the lock. The following
+test case demonstrates it:
+
+using System;
+using System.Threading;
+
+class Test
+{
+	static Test t;
+	static void Main(string [] args )
+	{
+		t = new Test ();
+		
+		Monitor.Enter (t);
+
+		Thread tr = new Thread (new ThreadStart (Run));
+		tr.Start ();
+	}
+
+	static void Run ()
+	{
+		Monitor.Exit (t);
+		Console.WriteLine ("Exit succeeded");
+	}
+}
+
+This works on MS.NET. So, the fix is very simple, I just removed the
+exception throwing.