Kaydet (Commit) be424348 authored tarafından Michael Meeks's avatar Michael Meeks

Defer grammar checker thread creation until use.

Avoid this thread being started and stranded in the forkit.

Change-Id: Ia79cdac729a85960c2b5a83af265d67af07b74aa
üst ae2fbc7c
...@@ -242,7 +242,7 @@ GrammarCheckingIterator::GrammarCheckingIterator() : ...@@ -242,7 +242,7 @@ GrammarCheckingIterator::GrammarCheckingIterator() :
m_aEventListeners( MyMutex::get() ), m_aEventListeners( MyMutex::get() ),
m_aNotifyListeners( MyMutex::get() ) m_aNotifyListeners( MyMutex::get() )
{ {
m_thread = osl_createThread( lcl_workerfunc, this ); m_thread = nullptr;
} }
...@@ -322,6 +322,8 @@ void GrammarCheckingIterator::AddEntry( ...@@ -322,6 +322,8 @@ void GrammarCheckingIterator::AddEntry(
// add new entry to the end of this queue // add new entry to the end of this queue
::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() );
if (!m_thread)
m_thread = osl_createThread( lcl_workerfunc, this );
m_aFPEntriesQueue.push_back( aNewFPEntry ); m_aFPEntriesQueue.push_back( aNewFPEntry );
// wake up the thread in order to do grammar checking // wake up the thread in order to do grammar checking
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment