Bug 4730 - mutex not blocking creation of same mutex
Summary: mutex not blocking creation of same mutex
Status: RESOLVED FEATURE
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-04-30 05:58 UTC by dglassey
Modified: 2012-06-18 21:48 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FEATURE

Description dglassey 2012-04-30 05:58:38 UTC
Using the example code for the mutex constructor

http://msdn.microsoft.com/en-us/library/bwe34f1k.aspx

running the app on one terminal gets the mutex
This process owns the named mutex. Press ENTER to release the mutex and exit.

Before pressing enter, running it a second time in another terminal window also get the mutex
This process owns the named mutex. Press ENTER to release the mutex and exit.

This means that mutexes can't be used to stop more than one copy of an app being run.
Comment 1 Zoltan Varga 2012-04-30 07:34:06 UTC
Try running with MONO_ENABLE_SHM:

http://www.mono-project.com/Release_Notes_Mono_2.8#Shared_handles_are_disabled_by_default