public void StartProvessingGoals() { while (!(Volatile.Read(ref _stop) && _transmitter.Count() == 0)) { var goal = _transmitter.GetGoal(); if (goal == null) { continue; } _utilizer.Utilize(goal); } }
private void ProcessGoals() { Goal goal; while (true) { goal = _transmitter.GetGoal(); if (goal == null) { break; } Goals.Add(goal.Id); } IsFinished = true; _waitHandle.Set(); }