I don't know how — I've searched and I will search some more — but it's possible because Microsoft's (formerly Sysinternal's) Process Explorer can list them. (They're listed as "Mutants" for some reason.) If it's just for debugging, maybe that tool will help you.
| [reply] |
Is it possible to list all Mutexes currently open?
Do you mean
- for the current process that you've explicitly opened within your own code?
- for the current process including those opened by perl's internals and modules you've called or libraries you are linked to?
- all the mutexes in the system that you might want to open a handle to?
All three are possible, but doing so requires the use of some fairly complex and obscure 'debugging' APIs. From memory, it also means using some officially 'undocumented' APIs--though my memory could be wrong on that.
It's also the case that, other than for the purposes of debugging, it is usually not necessary to generate a list of existing Mutexes, so if you were to describe why you want to do this, there may be a simpler way of achieving your goal.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |
It just occured to me that a DOS application that allowed me to view mutexes and semaphores might be a quicker way to debug than using Process Explorer from sysinternals. I believe they use an undocumented API called HandleEx.
| [reply] |
Hmm. The other tool around that can do this is SysInternals HandleEx. This apparently requires a custom (and non-open source) device driver to achieve it.
I'm positive I saw some sample code showing how to do this whilst searching for something else a coupe of years ago, but I cannot find it now.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |