This has a subtle bug. See http://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java