[Mono-list] single instance (mutex)
Robert Jordan
robertj at gmx.net
Wed Aug 24 11:32:26 EDT 2011
On 24.08.2011 16:15, ingemar wrote:
> hi!
>
> my problem is that i want a single instance from my win forms application.
> it works without problem using mutex in windows, but unfortunately not with
> mono.
>
> i found a possible solution in that forum:
>
> http://go-mono.com/forums/#nabble-td1493856
> .....
> It's a slight difference in behaviour that will be fixed eventually when
> I have time. If you really need to ensure only one instance is running,
> try calling mutex.WaitOne(0, false) and checking the return value.
>
> - Dick
>
> but that does not solve my problem.
>
> i'm grateful for any help!
Shared mutexes (or more generally: shared handles) are not
supported anymore (since Mono 2.8).
You may want to try to enable them with the env var
MONO_ENABLE_SHM=1, but it's still a now unsupported
feature.
Robert
More information about the Mono-list
mailing list