zcsizmadia / ZCS.DataContractResolver

MIT License
14 stars 1 forks source link

improve thread-safety #58

Closed symbiogenesis closed 6 months ago

symbiogenesis commented 6 months ago

This should be simpler

zcsizmadia commented 6 months ago

Afaik lazy is not thread safe.

symbiogenesis commented 6 months ago

Thread Safety By default, all public and protected members of the Lazy class are thread safe and may be used concurrently from multiple threads. These thread-safety guarantees may be removed optionally and per instance, using parameters to the type's constructors

https://learn.microsoft.com/en-us/dotnet/api/system.lazy-1?view=net-8.0#thread-safety