Skip to content

Commit

Permalink
Fix thread handling in test
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 15, 2022
1 parent 04676a6 commit f85f2b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/qgstestutils.cpp
Expand Up @@ -20,7 +20,7 @@
///@cond PRIVATE
///

static void getFeaturesForProvider( const QPair< QgsVectorDataProvider *, QgsFeatureRequest > &pair )
static void getFeaturesForProvider( const QPair< std::shared_ptr< QgsAbstractFeatureSource >, QgsFeatureRequest > &pair )
{
QgsFeatureIterator it = pair.first->getFeatures( pair.second );
QgsFeature f;
Expand All @@ -33,11 +33,11 @@ static void getFeaturesForProvider( const QPair< QgsVectorDataProvider *, QgsFea
bool QgsTestUtils::testProviderIteratorThreadSafety( QgsVectorDataProvider *provider, const QgsFeatureRequest &request )
{
constexpr int JOBS_TO_RUN = 100;
QList< QPair< QgsVectorDataProvider *, QgsFeatureRequest > > jobs;
QList< QPair< std::shared_ptr< QgsAbstractFeatureSource >, QgsFeatureRequest > > jobs;
jobs.reserve( JOBS_TO_RUN );
for ( int i = 0; i < JOBS_TO_RUN; ++i )
{
jobs.append( qMakePair( provider, request ) );
jobs.append( qMakePair( std::shared_ptr< QgsAbstractFeatureSource >( provider->featureSource() ), request ) );
}

//freaking hammer the provider with a ton of concurrent requests.
Expand Down

0 comments on commit f85f2b1

Please sign in to comment.