[stringtemplate-interest] thread-safety issue in ST-4.0.4

Terence Parr parrt at cs.usfca.edu
Sun Dec 4 10:50:16 PST 2011


hi! sync'd methods. please try /depot/ST4/java/main/dist/ST-4.0.5.jar at wesite
Ter
On Nov 24, 2011, at 1:41 AM, Oliver Flege wrote:

> 
> Hi,
> 
> I just found out the hard way that
> org.stringtemplate.v4.misc.ObjectModelAdaptor ist not thread-safe:
> 
> The field classAndPropertyToMemberCache can be accessed by multiple
> threads at the same time.
> Since org.antlr.runtime.misc.DoubleKeyMap and its internal
> java.util.LinkedHashMap aren't thread-safe, parallel puts might
> corrupt the map's structure (in my case: the pointers to the next
> Entry ended up forming an infinite loop).
> 
> classAndPropertyToMemberCache.get/put should be synchronized on
> a common mutex object.
> 
> Regards,
> Oliver
> 
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest



More information about the stringtemplate-interest mailing list