Use threadsafe singleton code.