PVDatabasePtr PVDatabase::getMaster() { static PVDatabasePtr master; static Mutex mutex; Lock xx(mutex); if(master.get()==NULL) { master = PVDatabasePtr(new PVDatabase()); } return master; }