What does a lock statement do under the hood?
I see that for using objects which are not thread safe we wrap the code with a lock like this: private static readonly Object obj = new Object(); lock (obj) { // thread unsafe code } So, what happens when multiple threads access the same code (let’s assume that it is running in a ASP.NET … Read more