System.LocalDataStoreMgr.AllocateNamedDataSlot C# (CSharp) Method

AllocateNamedDataSlot() public method

public AllocateNamedDataSlot ( String name ) : LocalDataStoreSlot
name String
return LocalDataStoreSlot
    	public LocalDataStoreSlot AllocateNamedDataSlot(String name)
    	{
            bool tookLock = false;
            RuntimeHelpers.PrepareConstrainedRegions();
            try {
                Monitor.ReliableEnter(this, ref tookLock);
        		// Allocate a normal data slot.
				LocalDataStoreSlot slot = AllocateDataSlot();

        		// Insert the association between the name and the data slot number
				// in the hash table.
        		m_KeyToSlotMap.Add(name, slot);
        		return slot;
        	}
            finally {
                if (tookLock)
                    Monitor.Exit(this);
            }
		}