Atmosphere/atmosphere — pull request #100 by ragingfury (2011-12-05 22:30:46+00:00)
Title: Atmosphere 0.8.x

Fix race conditions in DefaultBroadcasterFactory.

Race condition #1 when performing a lookup and creating if null. The synchronized statement in get(Class c, Object id) is insufficient to ensure that two threads don't create a broadcaster with the same ID. Two strings that are equal, but are different objects may enter the block at the same time. To fix, make the get() method call the lookup method, and change the lookup method to better use the ConcurrentHashMap methods to guarantee that only one broadcaster can be returned with a particular ID.

Fixed remove() to use ConcurrentHashMap method to guarantee atomicity.