void forEach(Consumer<T> c) {

		Set<T> toIterate = getSet();

		try {
			for (T t : toIterate) {
				c.accept(t);
			}
		}
		finally {
			iteratorCount.decrementAndGet();
		}
	}
A very specific data structure that provides 'copy on write' behavior while the client is
iterating the elements.
<p>
This class is meant for a very narrow and specific use case that includes: having a relatively
small number of listeners and the need for only basic adding, removing and iterating.
<p>
This class will create a new copy of its internal storage for any write operation, but only if
that happens while the elements in this class are being iterated.  This avoids unnecessary
copying.

@param <T> the storage type
Ghidra/Framework/Generic/src/main/java/ghidra/util/datastruct/ThreadSafeListenerStorage.java