Recently re-visited the double-check-locking pattern (or anti-pattern).
It doesn’t work in JDK 1.4 and earlier … however, in JDK 5, it’s updated memory model allows it to be used safely.
Wikipedia – Double Check Locking
Sun Blog on JDK 5 and Double Check Locking
Another possible solution that has the benefit of enforcing compilation ONLY with JDK 1.5 and later is a use of something called AtomicReference.
I haven’t played with them yet, but some information can be found at:
Introduction to Non-Blocking Algorithms
Filed under: Code