rails/rails — pull request #6426 by pinetops (2012-05-21 18:42:20+00:00)
Title: Prevent concurrent compilation of templates - closes #6400

This was already applied to 3-2 in commit 565c1b0a0772ac6cf91c77e9285806f7b028614c, so here's the 'forward-port'.

This addresses an issue where in multi-threaded environments
multiple threads can attempt to compile a template at the same time,
which occasionally causes particular templates to end up in a bad
state.

So, add synchronization such that only a single thread can attempt to
compile a template at one time.