/// <summary> /// 添加线程池监听 /// </summary> /// <param name="threadPoolExtend"></param> public static void AddThreadListen(ThreadPoolExtend <T> threadPoolExtend) { ThreadObject threadObj = new ThreadObject(); threadObj.threadPoolExtend = threadPoolExtend; threadObj.dt = DateTime.Now; threadObj.timeSpan = 1; index++; lock (obj) { if (!threadPoolExtends.Any(k => k.Value.threadPoolExtend == threadPoolExtend)) { threadPoolExtends.Add(new Guid().ToString() + index, threadObj); } } }
public AsynchronousHandler() { threadPoolExtend = new ThreadPoolExtend <T>(); }