grails/grails-core — pull request #543 by candrews (2014-10-14 20:52:19+00:00)
Title: Acquire the lock when getting or setting the value

The lock should be acquired when getting or setting the value, but in getValue() and setValue(V val) the lock wasn't being acquired.

This lack of locking can result in race conditions. I discovered this issue by clearing the GroovyPagesTemplateEngine cache in an infinite loop, which caused page metaclasses to not be removed, resulting in a memory leak.