private void ProcessParent(object parentKey, IReference <RuntimeGroupLeafObj> parentObj, RuntimeGroupLeafObjReference childObj, bool addToWaitList)
        {
            if (parentObj != null)
            {
                using (parentObj.PinValue())
                {
                    parentObj.Value().AddChild(childObj);
                }
                return;
            }
            (m_owner as RuntimeGroupRootObj).AddChild(childObj);
            if (!addToWaitList)
            {
                return;
            }
            ChildLeafInfo value     = null;
            IDisposable   reference = null;

            try
            {
                if (m_parentInfo == null)
                {
                    m_parentInfo = CreateParentInfo();
                }
                else
                {
                    m_parentInfo.TryGetAndPin(parentKey, out value, out reference);
                }
                if (value == null)
                {
                    value     = new ChildLeafInfo();
                    reference = m_parentInfo.AddAndPin(parentKey, value);
                }
                value.Add(childObj);
            }
            finally
            {
                reference?.Dispose();
            }
        }
Exemplo n.º 2
0
 internal IDisposable AddAndPin(object key, LookupMatches matches)
 {
     return(m_table.AddAndPin(key, matches));
 }