public synchronized void updateProgress(final int value){
  final Thread t=Thread.currentThread();
  final MyInteger v=mIndividualThreadProgress.get(t);
  if (v == null) {
    mIndividualThreadProgress.put(t,new MyInteger(value));
  }
 else {
    v.setValue(value);
  }
  if (value > mLastReportedProgress) {
    int min=Integer.MAX_VALUE;
    for (    final MyInteger m : mIndividualThreadProgress.values()) {
      if (m.getValue() < min) {
        min=m.getValue();
      }
    }
    if (min > mLastReportedProgress) {
      mLastReportedProgress=min;
      Diagnostic.progress("Processed " + min + "% of "+ mName);
    }
  }
}

public synchronized void updateProgress ( final int value ) { final Thread t = Thread . currentThread ( ) ; final MyInteger v = mIndividualThreadProgress . get ( t ) ; if ( v == null ) { mIndividualThreadProgress . put ( t , new MyInteger ( value ) ) ; } else { v . setValue ( value ) ; } if ( value > mLastReportedProgress ) { int min = Integer . MAX_VALUE ; for ( final MyInteger m : mIndividualThreadProgress . values ( ) ) { if ( m . getValue ( ) < min ) { min = m . getValue ( ) ; } } if ( min > mLastReportedProgress ) { mLastReportedProgress = min ; Diagnostic . progress ( "Processed " + min + "% of " + mName ) ; } } }
update progress , safe to use for multithreading .
