How to find out which thread has a lock on Mutex?

I use the .Net Mutex class to block parts of my application through threads. I had problems with blocking, and it would be very useful if I could find out the name of the thread that currently has the block.

Is there an easy way to do this?

+3
source share
2 answers

You cannot, Mutex is a wrapper around your own Windows descriptor. Windows obfuscates the descriptor values ​​so that no one looks into the internal structure of the kernel.

. ManagedId Name , . , , . VS2010 Ultimate Concurrency Visualizer.

+5

Mutux. , , , . WaitOne ReleaseMutex Mutex, - , .

+1

Source: https://habr.com/ru/post/1773094/


All Articles