[Mono-bugs] [Bug 76983][Maj] New - System.Threading.Mutex stays locked when process exits

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Dec 13 12:50:59 EST 2005

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 matze at braunis.de.


--- shadow/76983	2005-12-13 12:50:59.000000000 -0500
+++ shadow/76983.tmp.1301	2005-12-13 12:50:59.000000000 -0500
@@ -0,0 +1,65 @@
+Bug#: 76983
+Product: Mono: Class Libraries
+Version: 1.0
+OS Details: GNU/Linux
+Status: NEW   
+Priority: Major
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: matze at braunis.de               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: System.Threading.Mutex stays locked when process exits
+Description of Problem:
+When I create a locked System.Threading.Mutex object and don't explicitely
+call Mutex.ReleaseMutex() or if mono gets killed then the mutex will stay
+locked forever (until I manually remove all files from $HOME/.wapi).
+Steps to reproduce the problem:
+using System;
+using System.Threading;
+using System.IO;
+public class T {
+    public static void Main(string[] args) {
+        bool gotLock;
+        Mutex m = new Mutex(true, "mymutex", out gotLock);
+        Console.WriteLine("Acquired Lock: " + gotLock);
+    }
+Actual Results:
+[matze at taylor] ~/t > mcs t.cs
+[matze at taylor] ~/t > ./t.exe
+Acquired Lock: True
+[matze at taylor] ~/t > ./t.exe
+Acquired Lock: False
+Expected Results:
+2 times an "Acquired Lock: True" message
+How often does this happen? 
+Additional Information:
+I'm using gentoo linux on an x86 Pentium4 processor.
+[matze at taylor] ~/t > mono --version
+Mono JIT compiler version 1.1.10, (C) 2002-2005 Novell, Inc and
+Contributors. www.mono-project.com
+        TLS:           __thread
+        GC:            Included Boehm (with typed GC)
+        SIGSEGV      : normal

More information about the mono-bugs mailing list