make the returning of DTFI & NFI in CultureInfo atomic (#7998)
authorTarek Mahmoud Sayed <tarekms@microsoft.com>
Fri, 4 Nov 2016 20:15:17 +0000 (13:15 -0700)
committerJan Kotas <jkotas@microsoft.com>
Fri, 4 Nov 2016 20:15:17 +0000 (13:15 -0700)
commit342ba49767ebd256f1adf449b9cfd51de8e1d03f
tree175d526d7f280668309d1c3d9831b3dfb4ab3e19
parent76a1373b73ce420ba0acc6ad5ce3288d18deb84c
make the returning of DTFI & NFI in CultureInfo atomic (#7998)

we got some cases when more than one thread trying to get DTFI or NFI from the shared current culture object which can result returning different instances.
Although the returning object contents will be exactly but it'll be better to return same instance as apps may assume that. also returning the same instance will help reduce reinitializing more deeper fields when get requested.
src/mscorlib/corefx/System/Globalization/CultureInfo.cs
src/mscorlib/src/System/Globalization/CultureInfo.cs