Making map for component types thread safe