summaryrefslogtreecommitdiff
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 22:50:24 +0200
commit08364d213091e47b91b5fd044c7cda7e71d2647b (patch)
tree9bed7cb29e2f754cbca43428166d618a66e39c95 /linguistic
parent00c317da4b50db8793c4d7a2e70084b716d75735 (diff)
Defer grammar checker thread creation until use.
Avoid this thread being started and stranded in the forkit. Change-Id: Ia79cdac729a85960c2b5a83af265d67af07b74aa Reviewed-on: https://gerrit.libreoffice.org/52980 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
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 0f59515dcc15..b1dce0de8543 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -241,7 +241,7 @@ GrammarCheckingIterator::GrammarCheckingIterator() :
m_aEventListeners( MyMutex::get() ),
m_aNotifyListeners( MyMutex::get() )
{
- m_thread = osl_createThread( lcl_workerfunc, this );
+ m_thread = nullptr;
}
@@ -321,6 +321,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