code: public synchronized void stopCollecting() {
  		started = false;
  		if (thread != null) {
  			try {
  				thread.join();
  			} catch (InterruptedException e) {
  				// ignore
  			}
  			thread = null;
  		}
  	}
docs: Stop collecting.