summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorck <qt-info@nokia.com>2009-12-01 10:44:51 (GMT)
committerck <qt-info@nokia.com>2009-12-01 10:44:51 (GMT)
commitddc35a0fba647a9824ae45b135ff5cd098392684 (patch)
tree3530f368e543331815d0a8acb0713ae4062a18f1 /tools
parentb2bbdc8424c07bd958f1e96fdd332101f21d3881 (diff)
downloadQt-ddc35a0fba647a9824ae45b135ff5cd098392684.zip
Qt-ddc35a0fba647a9824ae45b135ff5cd098392684.tar.gz
Qt-ddc35a0fba647a9824ae45b135ff5cd098392684.tar.bz2
Assistant: Fix race condition in CLucene indexer.
We need to make sure the running thread can respond to the cancel request before overwriting it. Reviewed-by: kh1
Diffstat (limited to 'tools')
-rw-r--r--tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp1
-rw-r--r--tools/assistant/lib/qhelpsearchindexwriter_default.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp b/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp
index ab32537..b9aedbe 100644
--- a/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp
+++ b/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp
@@ -578,6 +578,7 @@ void QHelpSearchIndexWriter::cancelIndexing()
void QHelpSearchIndexWriter::updateIndex(const QString &collectionFile,
const QString &indexFilesFolder, bool reindex)
{
+ wait();
mutex.lock();
this->m_cancel = false;
this->m_reindex = reindex;
diff --git a/tools/assistant/lib/qhelpsearchindexwriter_default.cpp b/tools/assistant/lib/qhelpsearchindexwriter_default.cpp
index 06deb85..60b9642 100644
--- a/tools/assistant/lib/qhelpsearchindexwriter_default.cpp
+++ b/tools/assistant/lib/qhelpsearchindexwriter_default.cpp
@@ -184,6 +184,7 @@ void QHelpSearchIndexWriter::updateIndex(const QString &collectionFile,
const QString &indexFilesFolder,
bool reindex)
{
+ wait();
QMutexLocker lock(&mutex);
this->m_cancel = false;