code: public synchronized void replaceModel (MaxentModel model) {
  	replacementThread = Thread.currentThread();
  	while (!replacementCanProceed) Thread.yield();
  	setter.setModel(model);
  	replacementThread = null;
      }
docs: Replace the old model with a new one, forcing the replacement to wait
  until all threads using the old model have finished using it.
  
  @param model The new model which is being swapped in.