[Mono-bugs] [Bug 648133] New: Named System Mutex is not working
    bugzilla_noreply at novell.com 
    bugzilla_noreply at novell.com
       
    Wed Oct 20 16:44:00 EDT 2010
    
    
  
https://bugzilla.novell.com/show_bug.cgi?id=648133
https://bugzilla.novell.com/show_bug.cgi?id=648133#c0
           Summary: Named System Mutex is not working
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.6.x
          Platform: Other
        OS/Version: SLES 11
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: tony.ponzo at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development
           Blocker: ---
Problem Description: We are using a Named System Mutex to synchronize access to
a resource between multiple processes. But it does not seem to be working as
expected.
Steps to reproduce:
1 - compile the sample code below
2 - run 2 instances of the .exe concurrently
Result: 
a) both processes enter the lock area
b) In the process that starts first, a "Mutex is not owned" exception is thrown
when ReleaseMutex() is called.
Environment: Mono 2.6.7 on SLES 11
Sample Code below:
using System;
using System.Threading;
class Program 
{
    static void Main ()
    {
        Mutex mutex = new Mutex(false, "abcd123");
        bool locked = mutex.WaitOne();
        if (locked)
        {
            Console.WriteLine("I got the mutex");
            Thread.Sleep(5000);
            Console.WriteLine("Release the mutex");
            mutex.ReleaseMutex();
        }
    }
}
-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
    
    
More information about the mono-bugs
mailing list