System.LocalDataStoreMgr.GetNamedDataSlot C# (CSharp) Method

GetNamedDataSlot() public method

public GetNamedDataSlot ( String name ) : LocalDataStoreSlot
name String
return LocalDataStoreSlot
    	public LocalDataStoreSlot GetNamedDataSlot(String name)
    	{
            bool tookLock = false;
            RuntimeHelpers.PrepareConstrainedRegions();
            try {
                Monitor.ReliableEnter(this, ref tookLock);
        		// Lookup in the hashtable to try find a slot for the name.
        		LocalDataStoreSlot slot = (LocalDataStoreSlot) m_KeyToSlotMap[name];
        		
        		// If the name is not yet in the hashtable then add it.
        		if (null == slot)
        			return AllocateNamedDataSlot(name);
        		
        		// The name was in the hashtable so return the associated slot.
        		return slot;
        	}
            finally {
                if (tookLock)
                    Monitor.Exit(this);
            }
		}