I just realized that in some place in my code I have the return statement inside the lock and sometime outside. Which one is the best?
1)
void exampl
For what it's worth, the documentation on MSDN has an example of returning from inside of the lock. From the other answers on here, it does appear to be pretty similar IL but, to me, it does seem safer to return from inside the lock because then you don't run the risk of a return variable being overwritten by another thread.