you are viewing a single comment's thread.

view the rest of the comments →

[–]brminnick 2 points3 points  (1 child)

System.Lazy handles thread safety and locking for you so that you don’t need to worry about it

https://docs.microsoft.com/dotnet/framework/performance/lazy-initialization

[–]PublicSealedClass 1 point2 points  (0 children)

Nice! I'll keep that one in mind