tags:

views:

39

answers:

1

Hello,

We have a Mutext in our C# .Net Application created by following statement:

new Mutex(true, "MutexName", out pobjIOwnMutex);

Actually we have no problem with it, but since a while the Application can not take the ownership of this mutex anymore. This happens only on my developer pc. If I change the mutex name it is no problem, so I assume that the mutex still exists somewhere in the system.

Is there a way to release this mutex in the system, or could there be another reason which this happens?

Thanks for help, Enyra

A: 

Is a previous instance of the program running? Have you checked for handle leaks? Try using a tool such as Process Explorer to see if any processes have a handle open to that mutex.

wj32
No there is no instance of the program running, it also happens after rebooting the system.
Enyra
What do you mean by "can not take the ownership"? What exactly happens?
wj32
@wj32 in the snippet I posted the constructor of mutex takes an "out" paremeter indicating whether a new mutex has been created or not. If propjIOwnMutex = false (what happens in my case) the system already has as a mutex with the given name. This is what I call take the ownership.
Enyra