I have a strange problem, a deadlock problem, where if I pause the program using Visual Studio and inspect the threads I can only see two threads waiting on the lock. No thread appears to be inside the lock scope! Is Visual Studio just lying or how can a lock statement exit without releasing the lock?
Thanks
Do you have any explicit calls to
Monitor.Enter/Monitor.TryEnterin your code? Can you see the stack traces for those waiting threads? If so, look at where they’re waiting – that should make it obvious.