I'm using the C# lock() in my application to ensure that I don't have two or more threads executing the same block of code at the same time. The lock() was added after I did get collisions so I know that it's possible and bad things happen.
Now I'm trying to figure out how to get some sort of feedback/counter that I can use to determine just how often the lock is getting hit. I'm assuming I would have to hook into the Monitor class to get this information but thought I would ask if anyone has addressed this before?