diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2018-04-13 23:28:33 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-04-16 16:28:44 +0200 |
commit | 04ebb378e2027997a1d066fa2111258ab2f16f95 (patch) | |
tree | 7d341f281be130a9d9696834f18b4835ae8269ef | |
parent | 93e630a78330bb4b6076f8f638232dcc425f5b7c (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/52860
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r-- | linguistic/source/gciterator.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index f3553c4f1195..08fcdf499ca7 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 |