[Mono-bugs] [Bug 61687][Cri] New - Shared Mutex problems after any process exits
Sat, 17 Jul 2004 01:22:16 -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 firstname.lastname@example.org.
--- shadow/61687 2004-07-17 01:22:16.000000000 -0400
+++ shadow/61687.tmp.6657 2004-07-17 01:22:16.000000000 -0400
@@ -0,0 +1,50 @@
+Product: Mono: Runtime
+OS: Red Hat 9.0
+Summary: Shared Mutex problems after any process exits
+Description of Problem:
+When using a named mutex to protect resources across mutiple threads and
+processes, the mutex appears to become corrupt or lost after the first
+process exits. It doesn't matter if the first process to exit is the main
+thread or a child thread, the Mutex is useless at that point.
+Any further calls to ReleaseMutex will result in an error being written to
+the console about a failure to lookup the Mutex. The WaitOne call will
+begin to return False and not block on the named mutex as well.
+Steps to reproduce the problem:
+1. Complile the attached file "NewMutexText.cs"
+2. Run it
+3. Watch it crash and burn
+After the first process exits, many messages will be displayed about not
+being able to lookup the Mutex. When the next process comes to an end, it
+and all other processes and threads using the named mutex will hang.
+The app should execute all threads and processes normally and exit cleanly
+as it does when run on Windows using .Net.
+After building the assembly, it can be copied to a Windows box with .Net
+How often does this happen?
+Every time the application is run
+I wrote an app that used a FileStream class with FileShare.None as a
+replacement mutex and it ran fine on both SuSE 9.1 and RedHat 9.