hornetq/hornetq — pull request #1064 by FranciscoBorges (2013-05-16 13:29:36+00:00)
Title: Fix concurrent crash on HierarchicalObjectRepository 

@clebert, read also the added javadoc to the lock justifying the decisions. Feel free to close it if we need to discuss this more.

Notice that just making 'matches' a ConcurrentHashMap does not solve it.

We could have a race between the state of matches and the cache:
Thread1: addMatch(): i. clean cache; ii. add match to Map
Thread2: could add an (outdated) entry to the cache between 'i. clean cache' and
'ii. add match to Map'.