Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.15.0
-
None
Description
The following code snippet causes a deadlock of the thread pool if the number of files selected exceeds the number of available threads. The call of QImage::scaled does not return. The execution stops when calling QSemaphore::acquire in static inline void multithread_pixels_function (qimagescale_sse4.cpp).
With Qt version 5.14.0 the code works fine.
...
QStringList fileNames = QFileDialog::getOpenFileNames(nullptr, tr("Select Image Files"),
QString(),
tr("JPG (*.jpg)"));
for ( const QString& path : fileNames ) {
QtConcurrent::run([path]() {
QImage img(path);
if ( !img.isNull() )
{ img = img.scaled(100, 100, Qt::KeepAspectRatio, Qt::SmoothTransformation); }});
}
...
Attachments
Issue Links
- duplicates
-
QTBUG-84619 Use of global thread pool for image conversion is changes behavior in Qt5.15
-
- Closed
-