code: protected static UdpResources getOrCreate(@Nullable LoopResources loops,
  			Function<LoopResources, UdpResources> onNew, String name) {
  		UdpResources update;
  		for (; ; ) {
  			UdpResources resources = udpResources.get();
  			if (resources == null || loops != null) {
  				update = create(resources, loops, name, onNew);
  				if (udpResources.compareAndSet(resources, update)) {
  					if(resources != null) {
  						if (log.isWarnEnabled()) {
  							log.warn("[{}] resources will use a new LoopResources: {}," +
  									"the previous LoopResources will be disposed", name, loops);
  						}
  						resources.defaultLoops.dispose();
  					}
  					else {
  						String loopType = loops == null ? "default" : "provided";
  						if (log.isDebugEnabled()) {
  							log.debug("[{}] resources will use the {} LoopResources: {}", name, loopType, update.defaultLoops);
  						}
  					}
  					return update;
  				}
  				else {
  					update._dispose();
  				}
  			}
  			else {
  				return resources;
  			}
  		}
  	}
docs: Safely check if existing resource exist and proceed to update/cleanup if new
  resources references are passed.
  
  @param loops the eventual new {@link LoopResources}
  @param onNew a {@link UdpResources} factory
  @param name a name for resources
  
  @return an existing or new {@link UdpResources}