public static void For(int from, int to, Action <int> action)
 {
     using (var pool = new MyThreadPool(10))
     {
         for (int i = from; i < to; i++)
         {
             var captured = i;
             pool.EnqueueTask(() => action(captured));
         }
         pool.WaitTillCompletion();
     }
 }