The Java HashMap
class is not synchronised (and that is explicitly documented). This results in... interesting behaviour if two or more threads try to modify a HashMap at the same time.
Apparently, one of the failure modes is for the put()
method to get stuck in an infinite loop.