From b30dc0f1a588b88af9cb0aedec48ebfadff19f7a Mon Sep 17 00:00:00 2001 From: Abs62 Date: Thu, 8 Mar 2018 16:32:05 +0300 Subject: [PATCH] Zim: Fix threads synchronization while full-text indexing --- zim.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zim.cc b/zim.cc index b01fd5ca..22d84f69 100644 --- a/zim.cc +++ b/zim.cc @@ -985,6 +985,8 @@ void ZimDictionary::makeFTSIndex( QAtomicInt & isCancelled, bool firstIteration { if( Qt4x5::AtomicInt::loadAcquire( isCancelled ) ) throw exUserAbort(); + + Mutex::Lock _( zimMutex ); offsetsWithClusters.append( QPair< uint32_t, quint32 >( getArticleCluster( df, *it ), *it ) ); } @@ -1096,6 +1098,8 @@ void ZimDictionary::sortArticlesOffsetsForFTS( QVector< uint32_t > & offsets, { if( Qt4x5::AtomicInt::loadAcquire( isCancelled ) ) return; + + Mutex::Lock _( zimMutex ); offsetsWithClusters.append( QPair< uint32_t, quint32 >( getArticleCluster( df, *it ), *it ) ); }