System.Threading.Thread.Thread.LocalDataStore.EnsureNameToSlotMap C# (CSharp) Method

EnsureNameToSlotMap() public static method

public static EnsureNameToSlotMap ( ) : LocalDataStoreSlot>.Dictionary
return LocalDataStoreSlot>.Dictionary
            public static Dictionary<string, LocalDataStoreSlot> EnsureNameToSlotMap()
            {
                Dictionary<string, LocalDataStoreSlot> nameToSlotMap = s_nameToSlotMap;
                if (nameToSlotMap != null)
                {
                    return nameToSlotMap;
                }

                nameToSlotMap = new Dictionary<string, LocalDataStoreSlot>();
                return Interlocked.CompareExchange(ref s_nameToSlotMap, nameToSlotMap, null) ?? nameToSlotMap;
            }