Deadlock detection

Topics: For MSE Users, MSE FAQ
Dec 7, 2008 at 1:13 AM
This tiny little tool is simply great!

I'm searching for tools that I can use to analyse a .NET app that was deadlocked.
By checking the stack traces of all threads I should be able to find the two threads involved in the deadlock. Both should have a call to Monitor.Enter or similiar on the very top of the callstack.
I wrote a little sample app that creates a deadlock with two threads and two locks using Monitor.Enter. When I looked at it with MSE I could see the stack traces of the two involved threads but could not find the call to Monitor.Enter in the stacktrace. On the very top of the stack trace was the thread method itself. I then wrapped the call to Monitor.Enter in another method and this method was displayed in the stack trace...

Does anybody have an idea why the call to Monitor.Enter is not contained in the stack trace?