Ejemplo n.º 1
0
 public void ProcessFacts(object data)
 {
     lock (_lock)
     {
         Thread thread = new Thread(
             (state) => FactReader.GetAllFactsAsync(_factQueue, Signal)
             );
         _threads.Add(new Tuple <Thread, IThread>(thread, FactReader));
         thread.Start();
         thread = new Thread(
             (state) => MapWriter.PostProductionStopsAsync(_mapQueue, Signal)
             );
         _threads.Add(new Tuple <Thread, IThread>(thread, MapWriter));
         thread.Start();
         thread = new Thread(
             (state) => FactMapper.CalcProductionStopsAsync(_factQueue, _mapQueue, Signal)
             );
         _threads.Add(new Tuple <Thread, IThread>(thread, FactMapper));
         thread.Start();
     }
     while (_running)
     {
         _waitHandle.WaitOne();
     }
 }