示例#1
0
        public static int GetIth(int i)
        {
            threadQueue.Wait();
            if (i >= primes.Count)
            {
                CalcUntilIthPrime(i + 1);
            }
            int p = primes[i];

            threadQueue.Next();
            return(p);
        }
 void GenPrime()
 {
     tq.Wait();
     while (Exponent * Exponent > primes.Last())
     {
         SquareSieve();
     }
     tq.Next();
 }