示例#1
0
        public static INoLockPoolNode <T> GetNode()
        {
            INoLockPoolNode <T> ret = null;
            LinkedListNode <INoLockPoolNode <T> > n = m_NodePool.First;

            if (n != null)
            {
                m_NodePool.Remove(n);
                ret = n.Value;
            }
            if (ret != null)
            {
                return(ret);
            }

            ret = new T();
            return(ret);
        }
示例#2
0
 internal static void _DestroyNode(INoLockPoolNode <T> node)
 {
     if (node != null)
     {
         var n = node.PPoolNode;
         if (n.List != m_NodePool)
         {
             var list = n.List;
             if (list != m_NodePool)
             {
                 if (list != null)
                 {
                     list.Remove(n);
                 }
                 m_NodePool.AddLast(n);
             }
         }
     }
 }