Author: nbubna
Date: Mon Jan 4 16:29:21 2010
New Revision: 895683
URL: http://svn.apache.org/viewvc?rev=895683&view=rev
Log:
VELOCITY-750 fix RuntimeInstance lazy-init() double-checked locking under Java
1.5+
Modified:
velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/RuntimeInstance.java
Modified:
velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/RuntimeInstance.java
URL:
http://svn.apache.org/viewvc/velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/RuntimeInstance.java?rev=895683&r1=895682&r2=895683&view=diff
==============================================================================
---
velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/RuntimeInstance.java
(original)
+++
velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/RuntimeInstance.java
Mon Jan 4 16:29:21 2010
@@ -141,7 +141,7 @@
/**
* Indicate whether the Runtime has been fully initialized.
*/
- private boolean initialized = false;
+ private volatile boolean initialized = false;
/**
* These are the properties that are laid down over top