Beispiel #1
0
        /// <summary>
        /// 获取一个
        /// </summary>
        /// <param name="item"></param>
        public static DANMessage <T> TryTake()
        {
            var msg = new DANMessage <T>();

            if (GlobalCollection.TryTake(out msg))
            {
                return(msg);
            }
            return(null);
        }
Beispiel #2
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public static bool TryAdd(DANMessage <T> item)
 {
     return(GlobalCollection.TryAdd(item));
 }