Double-checked locking and a note on static objects