Skip to content

Commit 7062668

Browse files
committed
[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.
1 parent 7307650 commit 7062668

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/providers/arcgisrest/qgsafsshareddata.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ bool QgsAfsSharedData::getFeature( QgsFeatureId id, QgsFeature &f, const QgsRect
6262
return false;
6363
}
6464

65+
// don't lock while doing the fetch
66+
locker.unlock();
67+
6568
// Query
6669
QString errorTitle, errorMessage;
6770
const QVariantMap queryData = QgsArcGisRestUtils::getObjects(
@@ -75,6 +78,8 @@ bool QgsAfsSharedData::getFeature( QgsFeatureId id, QgsFeature &f, const QgsRect
7578
return false;
7679
}
7780

81+
// but re-lock while updating cache
82+
locker.relock();
7883
const QVariantList featuresData = queryData[QStringLiteral( "features" )].toList();
7984
if ( featuresData.isEmpty() )
8085
{

0 commit comments

Comments
 (0)