The range of situations in which volatile is effective was expanded in Java 5; in particular, double-checked locking now works correctly.
volatile使用范围在Java5中得到了扩展，特别是双重检查锁定现在能够正确工作。