mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Zim: Fix threads synchronization while full-text indexing
This commit is contained in:
parent
d3d978e7c9
commit
b30dc0f1a5
4
zim.cc
4
zim.cc
|
@ -985,6 +985,8 @@ void ZimDictionary::makeFTSIndex( QAtomicInt & isCancelled, bool firstIteration
|
||||||
{
|
{
|
||||||
if( Qt4x5::AtomicInt::loadAcquire( isCancelled ) )
|
if( Qt4x5::AtomicInt::loadAcquire( isCancelled ) )
|
||||||
throw exUserAbort();
|
throw exUserAbort();
|
||||||
|
|
||||||
|
Mutex::Lock _( zimMutex );
|
||||||
offsetsWithClusters.append( QPair< uint32_t, quint32 >( getArticleCluster( df, *it ), *it ) );
|
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 ) )
|
if( Qt4x5::AtomicInt::loadAcquire( isCancelled ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Mutex::Lock _( zimMutex );
|
||||||
offsetsWithClusters.append( QPair< uint32_t, quint32 >( getArticleCluster( df, *it ), *it ) );
|
offsetsWithClusters.append( QPair< uint32_t, quint32 >( getArticleCluster( df, *it ), *it ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue