SynchronizationLockException on Monitor.Exit when using await
问题 I am creating a piece of code that gets a webpage from a legacy system we have. In order to avoid excessive querying, I am caching the obtained URL. I am using Monitor.Enter , Monitor.Exit and double checking to avoid that request is issued twice, but when releasing the lock with Monitor.Exit , I am getting this exception: System.Threading.SynchronizationLockException was caught HResult=-2146233064 Message=Object synchronization method was called from an unsynchronized block of code. Source