예제 #1
0
PVDatabasePtr PVDatabase::getMaster()
{
    static PVDatabasePtr master;
    static Mutex mutex;
    Lock xx(mutex);
    if(master.get()==NULL) {
        master = PVDatabasePtr(new PVDatabase());
    }
    return master;
}
예제 #2
0
PVDatabasePtr PVDatabase::getMaster()
{
    static bool firstTime = true;
    if(firstTime) {
        firstTime = false;
        pvDatabaseMaster = PVDatabasePtr(new PVDatabase());
        PVArrayPlugin::create();
        PVTimestampPlugin::create();
        PVDeadbandPlugin::create();
    }    
    return pvDatabaseMaster;
}