MemoryAddressSetViews buildAddressSets(boolean rebuildAllAddrSets) {
		MemoryAddressSetViews localAddrSetViews = addrSetViews;
		if (!rebuildAllAddrSets && localAddrSetViews != null) {
			return localAddrSetViews;
		}
		lock.acquire();
		try {
			// have to try and get it again, another thread may have already filled it out
			if (!rebuildAllAddrSets && addrSetViews != null) {
				return addrSetViews;
			}

			// Begin rebuilding a complete set of address set views
			MemoryAddressSetViews newAddrSetViews = new MemoryAddressSetViews();

			// The allAddrSet instance is generally kept up-to-date with all memory
			// block addresses and need only be rebuilt under certain conditions as
			// signaled by the rebuildAllAddrs parameter.
			AddressSet newAllAddrs = null;
			if (rebuildAllAddrSets) {
				newAllAddrs = new AddressSet();
			}

			// we have to process the non-mapped blocks first because to process the mapped
			// blocks we need the address sets for the non-mapped blocks to be complete
			for (MemoryBlockDB block : blocks) {
				block.clearMappedBlockList();
				if (!block.isMapped()) {
					addBlockAddresses(block, newAddrSetViews, newAllAddrs);
				}
			}
			// process all mapped blocks after non-mapped-blocks above
			for (MemoryBlockDB block : blocks) {
				if (block.isMapped()) {
					addBlockAddresses(block, newAddrSetViews, newAllAddrs);
				}
			}
			if (newAllAddrs != null) {
				// replace allAddrSet with fully updated address set
				allAddrSet = new AddressSetViewAdapter(newAllAddrs);
			}
			addrSetViews = newAddrSetViews;
			return addrSetViews;
		}
		finally {
			lock.release();
		}
	}
Get the address set views {@code addrSetView} and rebuild if needed and optionally
rebuild {@code allAddrSet}.  This method also updates mapped-block details when
rebuilding the views.
<br>
NOTE: The {@link #initializeBlocks()} method is used to invalidate the {code addrSetViews}
without affecting {@code allAddrSet}, while {@link #reloadAll()} will force a complete
rebuild of all addresss sets.

@param rebuildAllAddrSets if true all address sets will be rebuilt before returning the
address set view object.
@return the address set view object
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/mem/MemoryMapDB.java