Skip to content
Permalink
Browse files

[afs] Don't lock shared data whilst fetching remote data

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 706266804e4a49abae66de68bd18eb2d9d2cdfc9
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/providers/arcgisrest/qgsafsshareddata.cpp
@@ -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(
@@ -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() )
{

0 comments on commit 7062668

Please sign in to comment.
You can’t perform that action at this time.