summaryrefslogtreecommitdiffstats
path: root/linguistic
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2018-04-13 23:28:33 +0100
committerMichael Meeks <michael.meeks@collabora.com>2018-04-16 14:09:26 +0100
commitbe4243487a6d33acd9bc59db1be5f3b5e87e4f04 (patch)
treec23679c5c766f4c77a03daabffa81ce4455a120e /linguistic
parentCollabora Office logo at Start Center (diff)
downloadcore-be4243487a6d33acd9bc59db1be5f3b5e87e4f04.tar.gz
core-be4243487a6d33acd9bc59db1be5f3b5e87e4f04.zip
Defer grammar checker thread creation until use.
Avoid this thread being started and stranded in the forkit. Change-Id: Ia79cdac729a85960c2b5a83af265d67af07b74aa
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/gciterator.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index aed7f1d28249..1c2d1fb80691 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -242,7 +242,7 @@ GrammarCheckingIterator::GrammarCheckingIterator() :
m_aEventListeners( MyMutex::get() ),
m_aNotifyListeners( MyMutex::get() )
{
- m_thread = osl_createThread( lcl_workerfunc, this );
+ m_thread = nullptr;
}
@@ -322,6 +322,8 @@ void GrammarCheckingIterator::AddEntry(
// add new entry to the end of this queue
::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() );
+ if (!m_thread)
+ m_thread = osl_createThread( lcl_workerfunc, this );
m_aFPEntriesQueue.push_back( aNewFPEntry );
// wake up the thread in order to do grammar checking