NLog/NLog — pull request #182 by brutaldev (2013-02-18 17:52:04+00:00)
Title: Fix for https://github.com/NLog/NLog/issues/162

- Attempt to fix issue described in
https://github.com/NLog/NLog/issues/162
- Added separate lock object to avoid a race in creating the layoutCache
object and skipping the lock during multiple instantiations. Also lock
the null check to avoid potential blunder by creating the same cache
value twice.
- This could also be solved without the additional lock by instantiating
the dictionary early (in the contructor) and locking with the reference
thereafter, chose this route to keep things lazy and consistent with the
rest of the object.