/* keep that in sync with gdaldrivermanager.cpp */ void GDALDatasetPool::PreventDestroy() { CPLMutexHolderD( GDALGetphDLMutex() ); if (! singleton) return; singleton->refCountOfDisableRefCount ++; }
GDALProxyPoolCacheEntry* GDALDatasetPool::RefDataset(const char* pszFileName, GDALAccess eAccess, char** papszOpenOptions, int bShared) { CPLMutexHolderD( GDALGetphDLMutex() ); return singleton->_RefDataset(pszFileName, eAccess, papszOpenOptions, bShared); }
/* keep that in sync with gdaldrivermanager.cpp */ void GDALDatasetPool::ForceDestroy() { CPLMutexHolderD( GDALGetphDLMutex() ); if (! singleton) return; singleton->refCountOfDisableRefCount --; CPLAssert(singleton->refCountOfDisableRefCount == 0); singleton->refCount = 0; delete singleton; singleton = NULL; }
void GDALDatasetPool::Ref() { CPLMutexHolderD( GDALGetphDLMutex() ); if (singleton == NULL) { int maxSize = atoi(CPLGetConfigOption("GDAL_MAX_DATASET_POOL_SIZE", "100")); if (maxSize < 2 || maxSize > 1000) maxSize = 100; singleton = new GDALDatasetPool(maxSize); } if (singleton->refCountOfDisableRefCount == 0) singleton->refCount++; }
void GDALDatasetPool::Unref() { CPLMutexHolderD( GDALGetphDLMutex() ); if (! singleton) { CPLAssert(0); return; } if (singleton->refCountOfDisableRefCount == 0) { singleton->refCount--; if (singleton->refCount == 0) { delete singleton; singleton = NULL; } } }
void GDALDatasetPool::UnrefDataset(GDALProxyPoolCacheEntry* cacheEntry) { CPLMutexHolderD( GDALGetphDLMutex() ); cacheEntry->refCount --; }
GDALProxyPoolCacheEntry* GDALDatasetPool::RefDataset(const char* pszFileName, GDALAccess eAccess) { CPLMutexHolderD( GDALGetphDLMutex() ); return singleton->_RefDataset(pszFileName, eAccess); }
void GDALDatasetPool::CloseDataset(const char* pszFileName, GDALAccess eAccess) { CPLMutexHolderD( GDALGetphDLMutex() ); singleton->_CloseDataset(pszFileName, eAccess); }