Code example for AtomicBoolean

Methods: compareAndSet, set

0
		return compare > 0;
	} 
 
	public void flushCache() 
	{ 
		if(_working.compareAndSet(false,true))
		{ 
			_result = null;
			_working.set(false);
		} 
	} 
 
	private void _regen() 
	{ 
		if(!isCacheStale()) 
			return; 
 
		boolean isMe = false;
		while(_working.get() == false)
			isMe = _working.compareAndSet(false, true);