This might help peoplee trying to verify their lock/unlock implementations: Test the functionality by setting break-points in the code at appropriate location. What I did was to set a break point after a call to lock, starting the clien in the debugger, and then starting other clients that try to lock the same record to see if the call blocked properly. I think simulating many threads/clients is still tricky as compared to testing one or two clients with the right break-points set to see how they operate step by step. There's not much too it, but it makes life easy when you want to see how your locking code operates.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads