diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2024-05-18 22:08:22 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2024-07-26 13:37:26 +0200 |
commit | f9df8d71a9d4ad2e7bc2e221551d9ee007f9fc60 (patch) | |
tree | 943172c401e9f870940be6cf47d4a00e7ef50371 /desktop/source | |
parent | dbfa56584cac08cae733513c13803a9c6ece22f6 (diff) |
lok: join Webdav Ticker thread.
Add 'startThreads' lok method for the few thread scenarios where
we need to have a background thread running that cannot be started
opportunistically.
Also add that to the ThreadJoinable interface so we can get into
UNO components' implementations to handle their worker threads
easily.
Implement joining and re-starting in WebDAV ucp too.
Change-Id: I329ef9decb32b263197e4c03a0d54952985fdd0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167858
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170979
Tested-by: Jenkins
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/lib/init.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 7d4b9d5041f6..442d88eaeecf 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2575,6 +2575,8 @@ static void lo_stopURP(LibreOfficeKit* pThis, void* pSendURPToLOContext); static int lo_joinThreads(LibreOfficeKit* pThis); +static void lo_startThreads(LibreOfficeKit* pThis); + static void lo_setForkedChild(LibreOfficeKit* pThis, bool bIsChild); static void lo_runLoop(LibreOfficeKit* pThis, @@ -2625,6 +2627,7 @@ LibLibreOffice_Impl::LibLibreOffice_Impl() m_pOfficeClass->startURP = lo_startURP; m_pOfficeClass->stopURP = lo_stopURP; m_pOfficeClass->joinThreads = lo_joinThreads; + m_pOfficeClass->startThreads = lo_startThreads; m_pOfficeClass->setForkedChild = lo_setForkedChild; m_pOfficeClass->extractDocumentStructureRequest = lo_extractDocumentStructureRequest; @@ -3443,6 +3446,12 @@ static int lo_joinThreads(LibreOfficeKit* /* pThis */) if (joinable && !joinable->joinThreads()) return 0; + auto ucpWebdav = xContext->getServiceManager()->createInstanceWithContext( + "com.sun.star.ucb.WebDAVManager", xContext); + joinable = dynamic_cast<comphelper::LibreOfficeKit::ThreadJoinable *>(ucpWebdav.get()); + if (joinable && !joinable->joinThreads()) + return 0; + // Ensure configmgr's write thread is down css::uno::Reference< css::util::XFlushable >( css::configuration::theDefaultProvider::get( @@ -3452,6 +3461,15 @@ static int lo_joinThreads(LibreOfficeKit* /* pThis */) return 1; } +static void lo_startThreads(LibreOfficeKit* /* pThis */) +{ + auto ucpWebdav = xContext->getServiceManager()->createInstanceWithContext( + "com.sun.star.ucb.WebDAVManager", xContext); + auto joinable = dynamic_cast<comphelper::LibreOfficeKit::ThreadJoinable *>(ucpWebdav.get()); + if (joinable) + joinable->startThreads(); +} + static void lo_setForkedChild(LibreOfficeKit* /* pThis */, bool bIsChild) { comphelper::LibreOfficeKit::setForkedChild(bIsChild); |