umco / umbraco-ditto

Ditto - the friendly view-model mapper for Umbraco
http://our.umbraco.org/projects/developer-tools/ditto
MIT License
79 stars 33 forks source link

AttributedTypeResolver - Adds locks to prevent concurrency issue #241

Closed leekelleher closed 5 years ago

leekelleher commented 6 years ago

Second attempt to fix #238


I originally thought that using a ConcurrentDictionary would mitigate from the concurrency issue, as outlined in issue #238. But that doesn't appear to be the case. I'm not sure why we'd want to use a ConcurrentDictionary if it's not working as expected - which, is most likely due to my understanding of how it actually works. This patch changes from using ConcurrentDictionary to a regular generic Dictionary, adding locks to prevent concurrently issues between reads/writes.