protected int[] readValues(int[] values){
synchronized (workers) {
    int count=workers.size();
    if (values == null || values.length != count) {
      values=new int[count];
    }
    int i=0;
    final Iterator<WorkerThread> iter=workers.iterator();
    while (iter.hasNext() && i < values.length) {
      final WorkerThread worker=iter.next();
      values[i++]=worker.getIterations();
    }
  }
  return values;
}

protected int [ ] readValues ( int [ ] values ) { synchronized ( workers ) { int count = workers . size ( ) ; if ( values == null || values . length != count ) { values = new int [ count ] ; } int i = 0 ; final Iterator < WorkerThread > iter = workers . iterator ( ) ; while ( iter . hasNext ( ) && i < values . length ) { final WorkerThread worker = iter . next ( ) ; values [ i ++ ] = worker . getIterations ( ) ; } } return values ; }
read the latest iteration counts from all available workerthreads .
