I should have mentioned two things in my previous post. 1) There are no locks involved. No need, because the solution relies on the fact that static member variables are guaranteed to be created the first time they are accessed. 2) Note that we have constructor disabled. This is important not to forget. ;)