Skip to content

Commit

Permalink
[afs] Don't lock shared data whilst fetching remote data
Browse files Browse the repository at this point in the history
Since the fetch can be slow, there's no need to lock other
afs threads while we wait for a particular set of results to
be fetched.
  • Loading branch information
nyalldawson committed Feb 20, 2018
1 parent 7307650 commit 7062668
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/providers/arcgisrest/qgsafsshareddata.cpp
Expand Up @@ -62,6 +62,9 @@ bool QgsAfsSharedData::getFeature( QgsFeatureId id, QgsFeature &f, const QgsRect
return false;
}

// don't lock while doing the fetch
locker.unlock();

// Query
QString errorTitle, errorMessage;
const QVariantMap queryData = QgsArcGisRestUtils::getObjects(
Expand All @@ -75,6 +78,8 @@ bool QgsAfsSharedData::getFeature( QgsFeatureId id, QgsFeature &f, const QgsRect
return false;
}

// but re-lock while updating cache
locker.relock();
const QVariantList featuresData = queryData[QStringLiteral( "features" )].toList();
if ( featuresData.isEmpty() )
{
Expand Down

0 comments on commit 7062668

Please sign in to comment.