示例#1
0
        /// <summary>
        /// Releases an object back into the object pool.
        /// </summary>
        /// <param name="obj">The object to be released.</param>
        public static void ReleaseObject(object obj)
        {
            if (m_event.WaitOne(3000, false))
            {
                if (m_types.ContainsKey(obj.GetType().ToString()))
                {
                    IObjectPool pool = m_types[obj.GetType().ToString()];

                    if (pool != null)
                    {
                        pool.Enqueue(obj);
                    }
                }
            }
        }