I have a function that looks like this
public void DoSomething(){ var lockThis = new Object(); lock(lockThis){ //trying to step through code } } So I place a breakpoint within lock(lockThis){...}. In theory, only one thread is in the critical section at a time, but can't I step through? It breaks at the first line of code within it, and it keeps hitting the same line. The breakpoints behave just like outside the lock.
EDIT: I should describe the environment. This class and the method arewithin the middle tier DLL. The method is called by a webservice in an ASP.NET application. I am doing a stress test on the webservice which spawns multiple threads that call the above method.