Skip to content


Browse files Browse the repository at this point in the history
Fix deadlock when number of point cloud files loaded >= available thr…

This would cause multiple QgsTasks to be created, each of which
uses one thread -- then if the number of tasks matches or exceeds
the number of available threads, then the call to blockingMapped
in QgsPointCloudStatsCalculator will hang forever waiting for
a thread to be freed (which will never happen, since the running
tasks CANNOT complete as they are blocked)

Avoid this by releasing and reserving the current thread
from the QgsPointCloudStatsCalculationTask before performing
the blockingMapped function.
  • Loading branch information
nyalldawson authored and github-actions[bot] committed May 2, 2023
1 parent 63e61e0 commit 54cea61
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/pointcloud/qgspointcloudstatscalculator.cpp
Expand Up @@ -209,7 +209,9 @@ bool QgsPointCloudStatsCalculator::calculateStats( QgsFeedback *feedback, const

feedback->setProgress( 0 );

QVector<QgsPointCloudStatistics> list = QtConcurrent::blockingMapped( nodes, StatsProcessor( mIndex.get(), mRequest, feedback, 100.0 / ( double )nodes.size() ) );

for ( QgsPointCloudStatistics &s : list )
Expand Down

0 comments on commit 54cea61

Please sign in to comment.