[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - linguistic/source

Michael Meeks michael.meeks at collabora.com
Mon Apr 16 13:25:20 UTC 2018


 linguistic/source/gciterator.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit be4243487a6d33acd9bc59db1be5f3b5e87e4f04
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Apr 13 23:28:33 2018 +0100

    Defer grammar checker thread creation until use.
    
    Avoid this thread being started and stranded in the forkit.
    
    Change-Id: Ia79cdac729a85960c2b5a83af265d67af07b74aa

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


More information about the Libreoffice-commits mailing list