Code example for AtomicBoolean

Methods: getAndSet

0
	} 
	 
	private void setAndGetFlag() { 
		 
 
		if (flag.getAndSet(true)) {
			int dummy = 0;
			if (dummy == 0) {
				dummy = 1;
			} 
		} 
		 
	} 
 
 
	public static void main(String[] args) throws InterruptedException {
		 
		final AtomicBooleanTest test = new AtomicBooleanTest();
 
		CountTime.run(new Runnable() {