Exemplo n.º 1
0
        /// <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);
                }
            }
        }
Exemplo n.º 2
0
 public AsynchronousHandler()
 {
     threadPoolExtend = new ThreadPoolExtend <T>();
 }