summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2024-05-24 21:45:44 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-07-28 17:22:54 +0200
commitb707ca9651a3d1b679b81b7d2aec1baf3d596090 (patch)
tree4ead20b272f39bb2448e18c9018f84416a9f9fdd /desktop/source
parentc658efe24f7a7eb4234c1c64668ea115788272e7 (diff)
cool#9082 - lok: cleanup WakeUpThread before forking, then re-start.
It seems likely that this lingering briefly after various un-identified and tough to reproduce, longer running operations in calc - which is a big ScProgress user - caused problems with background save. Change-Id: I1d0ec56c759dff30c48c8562b6400b57be4a25b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168033 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168052 Tested-by: Jenkins
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/lib/init.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 442d88eaeecf..4fab9477f330 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3435,9 +3435,6 @@ static int lo_joinThreads(LibreOfficeKit* /* pThis */)
comphelper::ThreadPool &pool = comphelper::ThreadPool::getSharedOptimalPool();
pool.joinThreadsIfIdle();
-// if (comphelper::getWorkerCount() > 0)
-// return 0;
-
// Grammar checker thread
css::uno::Reference<css::linguistic2::XLinguServiceManager2> xLangSrv =
css::linguistic2::LinguServiceManager::create(xContext);
@@ -3452,6 +3449,12 @@ static int lo_joinThreads(LibreOfficeKit* /* pThis */)
if (joinable && !joinable->joinThreads())
return 0;
+ auto progressThread = xContext->getServiceManager()->createInstanceWithContext(
+ "com.sun.star.task.StatusIndicatorFactory", xContext);
+ joinable = dynamic_cast<comphelper::LibreOfficeKit::ThreadJoinable *>(progressThread.get());
+ if (joinable && !joinable->joinThreads())
+ return 0;
+
// Ensure configmgr's write thread is down
css::uno::Reference< css::util::XFlushable >(
css::configuration::theDefaultProvider::get(
@@ -3468,6 +3471,12 @@ static void lo_startThreads(LibreOfficeKit* /* pThis */)
auto joinable = dynamic_cast<comphelper::LibreOfficeKit::ThreadJoinable *>(ucpWebdav.get());
if (joinable)
joinable->startThreads();
+
+ auto progressThread = xContext->getServiceManager()->createInstanceWithContext(
+ "com.sun.star.task.StatusIndicatorFactory", xContext);
+ joinable = dynamic_cast<comphelper::LibreOfficeKit::ThreadJoinable *>(progressThread.get());
+ if (joinable)
+ joinable->startThreads();
}
static void lo_setForkedChild(LibreOfficeKit* /* pThis */, bool bIsChild)