Example #1
0
 static void ConsumerJob(int[] destination, Counter counter, BlockingQueue blockingQueue)
 {
     while (true)
     {
         lock (counter)
         {
             if (counter.getCounterValue() >= destination.Length)
             {
                 break;
             }
             try
             {
                 destination[counter.getCounterValue()] = blockingQueue.Consume();
                 counter.Increment();
             }
             catch (Exception ex)
             {
                 File.AppendAllText(@"C:\inetpub\wwwroot\debug.txt", ex.Message + " " + ex.StackTrace + Environment.NewLine);
             }
         }
     }
 }