On 27/11/2012 10:49, Konstantin Kolinko wrote: > 2012/11/27 <ma...@apache.org>: >> Author: markt >> Date: Tue Nov 27 10:35:30 2012 >> New Revision: 1414110 >> >> URL: http://svn.apache.org/viewvc?rev=1414110&view=rev
> A ReadWriteLock cannot be used to guard a WeakHashMap. The > WeakHashMap may modify itself on get(), as it processes the reference > queue of items removed by GC. > > Either a plain old lock / synchronization is needed, or some other solution > (e.g. org.apache.tomcat.util.collections.ManagedConcurrentWeakHashMap ) Sorry, I should have remembered that having been bitten by it before. I think ManagedConcurrentWeakHashMap is my preferred option. The question is where to trigger maintain() from. I don't want to create a dependency between this class and any other part of Tomcat as I would like this implementation to be self-contained. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org