make others wait when one thread is generating parents map