ConcurrentBag扩展 批量加入

public static void AddRange<T>(this ConcurrentBag<T> @this, IEnumerable<T> toAdd)
    {
        foreach (var element in toAdd)
        {
            @this.Add(element);
        }
    }

 

posted on 2017-12-15 15:34  武胜-阿伟  阅读(852)  评论(1编辑  收藏  举报