For blocking, I use one static object global for my application:
public class MvcApplication : System.Web.HttpApplication { public static readonly object AppLock = new object(); ... }
Use to lock code:
lock(MvcApplication.AppLock) { ... }
Let's not look at the impact of performance on the moment. Can I be 100% sure that in this case I will avoid a dead end?
source share