private Map<K, V> getOrLoadMap() {
		Map<K, V> map;
		synchronized (this) {
			map = getMap();
			if (map != null) {
				return map;
			}
		}

		// We must get the database lock before calling loadMap().  Also, we can't get the
		// database lock while having the synchronization lock for this class or a deadlock can
		// occur, since the other methods may be called while the client has the db lock.
		// Note: all other places where the map is being used or manipulated, it must be done
		// while having the class's synchronization lock since the map itself is not thread safe.
		// It should be safe here since it creates a new map and then in one operation it sets it
		// as the map to be used elsewhere.

		lock.acquire();
		try {
			map = getMap();
			if (map == null) {
				map = loadMap();
				softRef = new SoftReference<>(map);
			}
			return map;
		}
		finally {
			lock.release();
		}
	}
Returns an unmodifiable view of the values in this map.
@return an unmodifiable view of the values in this map.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/LazyLoadingCachingMap.java