Code example for AtomicInteger

Methods: addAndGet

0
	 * 
	 * @param count 
	 *            the number of worker threads that are starting. 
	 */ 
	public void startWorkers(int count) {
		workers.addAndGet(count);
	} 
 
	/** Notify the monitor a worker is finished. */ 
	public void endWorker() { 
		if (workers.decrementAndGet() == 0)
			process.release();
	} 
 
	/** 
	 * Non-blocking poll for pending updates. 
	 * 
	 * This method can only be invoked by the same thread that allocated this 
	 * ThreadSafeProgressMonior. 
	 */ 
	public void pollForUpdates() {