+ small fix to avoid system error by "killing" the indexing

This commit is contained in:
kelson42 2012-04-07 20:27:56 +00:00
parent 6e5d8f717e
commit 1fd0314f1e
1 changed files with 9 additions and 9 deletions

View File

@ -128,7 +128,6 @@ namespace kiwix {
found = htmlParser.dump.find("NOINDEX"); found = htmlParser.dump.find("NOINDEX");
if (found == string::npos) { if (found == string::npos) {
/* Get the accented title */ /* Get the accented title */
token.accentedTitle = (htmlParser.title.empty() ? token.title : htmlParser.title); token.accentedTitle = (htmlParser.title.empty() ? token.title : htmlParser.title);
@ -157,9 +156,10 @@ namespace kiwix {
token.content = removeAccents(htmlParser.dump); token.content = removeAccents(htmlParser.dump);
self->pushToIndexQueue(token); self->pushToIndexQueue(token);
/* Test if the thread should be cancelled */
pthread_testcancel();
} }
/* Test if the thread should be cancelled */
pthread_testcancel();
} }
self->articleParserRunning(false); self->articleParserRunning(false);
@ -394,17 +394,17 @@ namespace kiwix {
pthread_mutex_lock(&threadIdsMutex); pthread_mutex_lock(&threadIdsMutex);
if (isArticleExtractorRunning) { if (isArticleIndexerRunning) {
pthread_cancel(this->articleExtractor); pthread_cancel(this->articleIndexer);
this->articleExtractorRunning(false); this->articleIndexerRunning(false);
} }
if (isArticleParserRunning) { if (isArticleParserRunning) {
pthread_cancel(this->articleParser); pthread_cancel(this->articleParser);
this->articleParserRunning(false); this->articleParserRunning(false);
} }
if (isArticleIndexerRunning) { if (isArticleExtractorRunning) {
pthread_cancel(this->articleIndexer); pthread_cancel(this->articleExtractor);
this->articleIndexerRunning(false); this->articleExtractorRunning(false);
} }
pthread_mutex_unlock(&threadIdsMutex); pthread_mutex_unlock(&threadIdsMutex);