Exemple #1
0
        static void Main(string[] args)
        {
            var tp = new MyThreadPool(CancellationToken.None);
            var l  = new ThreadPoolListener(tp);

            for (var i = 0; i < 100; i++)
            {
                tp.AddAction(() => { i++; }, CancellationToken.None);
            }
            Console.WriteLine("Hello World!");
            Console.ReadLine();
        }
Exemple #2
0
 public ThreadPoolListener(MyThreadPool threadPool)
 {
     _threadPool = threadPool;
     _threadPool.OnFinishedActionEvent += ShowFinishedInfo;
 }