Skip to content

Commit

Permalink
silence warning
Browse files Browse the repository at this point in the history
  • Loading branch information
chacha21 committed Jan 20, 2022
1 parent aa97abb commit f2e6296
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gcore/gdalabstractbandblockcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ bool CPL_STDCALL
ApplyCacheHelperFlushHandler( const GDALDataset* currentDataset, const GDALDataset* datasetThatCouldBeFlushed, void* cacheManager)
{
bool result = false;
if( pfnCacheFlushHelperHandler != nullptr ) //quick test to avoid locking
volatile GDALCacheFlushHelperHandler* pPfnCacheFlushHelperHandler = &pfnCacheFlushHelperHandler;//to avoid compiler warning about "inner-if" always true
if(pPfnCacheFlushHelperHandler != nullptr ) //quick test to avoid locking
{
CPLMutexHolderD( &hCacheHelperMutex );
if( pfnCacheFlushHelperHandler != nullptr )
result = pfnCacheFlushHelperHandler(currentDataset, datasetThatCouldBeFlushed, cacheManager, pCacheFlushHelperHandlerUserData);
GDALCacheFlushHelperHandler _pfnCacheFlushHelperHandler = *pPfnCacheFlushHelperHandler;
if( _pfnCacheFlushHelperHandler != nullptr )
result = _pfnCacheFlushHelperHandler(currentDataset, datasetThatCouldBeFlushed, cacheManager, pCacheFlushHelperHandlerUserData);
}
return result;
}
Expand Down

0 comments on commit f2e6296

Please sign in to comment.