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(); } }
internal bool TryGetAndPinValue(object key, out LookupMatches matches, out IDisposable cleanupRef) { return(m_table.TryGetAndPin(key, out matches, out cleanupRef)); }