Fix race condition in ~QFileInfoGatherer
tst_qfilesystemmodel was hanging regularly. In QFileInfoGatherer::~QFileInfoGatherer() it would be stuck on wait() and in QFileInfoGatherer::run() it would be at condition.wait(&mutex); It looks like while abort was set to true, the while in run() had just entered so that it would wait for condition indefinitely. Task-number: QTBUG-29403 Change-Id: If6cebbc98ec7f54fbdf347804780bbfc5e177b3b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>bb10
parent
c74f60b09d
commit
d14abab0d3
|
|
@ -94,7 +94,9 @@ QFileInfoGatherer::QFileInfoGatherer(QObject *parent)
|
|||
QFileInfoGatherer::~QFileInfoGatherer()
|
||||
{
|
||||
abort.store(true);
|
||||
QMutexLocker locker(&mutex);
|
||||
condition.wakeAll();
|
||||
locker.unlock();
|
||||
wait();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue