[Mono-bugs] [Bug 60887][Wis] New - Mutex error / threading error

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 29 Jun 2004 10:37:01 -0400 (EDT)


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 jeff.evans@vmd.desjardins.com.

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

--- shadow/60887	2004-06-29 10:37:01.000000000 -0400
+++ shadow/60887.tmp.1642	2004-06-29 10:37:01.000000000 -0400
@@ -0,0 +1,86 @@
+Bug#: 60887
+Product: Mono: Class Libraries
+Version: unspecified
+OS: Solaris 8
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jeff.evans@vmd.desjardins.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Mutex error / threading error
+
+Description of Problem:
+
+When using Mutexes in mono on Solaris 8, a warning/error message is 
+displayed after 2 threads have waited for a mutex.
+
+I am using the following code (example output follows)
+
+---------------------[ mutex.cs ]-----------------------------------
+using System;
+using System.Threading;
+
+namespace MutexTest
+{	
+	class Class1
+	{
+		[STAThread]
+		static void Main(string[] args)
+		{
+			bool bNew = false;
+			Mutex mtx = new Mutex (false, "my.mr.mutex", out 
+bNew);
+
+			System.Console.WriteLine ("Created my.mr.mutex.. " 
++ bNew);
+			System.Console.WriteLine ("Waiting...");
+
+			mtx.WaitOne ();
+
+			System.Console.WriteLine ("got it!");
+			System.Console.WriteLine ("sleeping for 20");
+				System.Threading.Thread.Sleep (20000);
+			System.Console.WriteLine ("awoken...");
+
+			mtx.ReleaseMutex(); mtx = null;
+
+			System.Console.WriteLine ("done");
+		}
+	}
+}
+---------------------[ mutex.cs ]-----------------------------------
+
+
+To test this, I create 'mutextest.exe' -- I start one copy of the program,
+which runs and creates the following output:
+
+
+------- output of instance #1 ----------
+create my.mr.mutex.. True
+Waiting...
+got it!
+sleeping for 20
+awoken....
+done
+
+
+After starting instance #1, I wait a few seconds and start a second 
+instance, which produces the following output:
+
+
+------- output of instance #2 ------------
+Created my.mr.mutex.. False
+Waiting...
+got it!
+sleeping for 20
+awoken...
+
+** (MutexTest.exe:15790): WARNING **: error looking up mutex handle 9
+done