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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jul 18 15:34:37 UTC 2018


 comphelper/source/misc/threadpool.cxx |    9 ++++-----
 desktop/source/lib/init.cxx           |    4 ++++
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit d69e830fb874582459134d483e7698d9dad805c6
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Wed Jul 18 12:23:10 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Jul 18 17:34:13 2018 +0200

    Allow the comphelper threadpool to be reset after construction.
    
    Otherwise some pre-init components can start it, and threads get
    stranded in the forkit process causing grief.
    
    Change-Id: Ib1846f8b329b4c6b84645999dafba1252c5129c7
    Reviewed-on: https://gerrit.libreoffice.org/57634
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/comphelper/source/misc/threadpool.cxx b/comphelper/source/misc/threadpool.cxx
index 23e363213206..457b7282fced 100644
--- a/comphelper/source/misc/threadpool.cxx
+++ b/comphelper/source/misc/threadpool.cxx
@@ -126,13 +126,12 @@ sal_Int32 ThreadPool::getPreferredConcurrency()
     return ThreadCount;
 }
 
-// FIXME: there should be no need for this as/when our baseline
-// is >VS2015 and drop WinXP; the sorry details are here:
-// https://connect.microsoft.com/VisualStudio/feedback/details/1282596
+// Used to order shutdown, and to ensure there are no lingering
+// threads after LibreOfficeKit pre-init.
 void ThreadPool::shutdown()
 {
-    if (mbTerminate)
-        return;
+//    if (mbTerminate)
+//        return;
 
     std::unique_lock< std::mutex > aGuard( maMutex );
     shutdownLocked(aGuard);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 60f6d5e0f18b..79e975ddbe6e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -36,6 +36,7 @@
 #include <comphelper/string.hxx>
 #include <comphelper/propertysequence.hxx>
 #include <comphelper/scopeguard.hxx>
+#include <comphelper/threadpool.hxx>
 
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
@@ -3988,7 +3989,10 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
     }
 
     if (eStage == PRE_INIT)
+    {
+        comphelper::ThreadPool::getSharedOptimalPool().shutdown();
         rtl_alloc_preInit(rtlAllocPostInit);
+    }
 
     return bInitialized;
 }


More information about the Libreoffice-commits mailing list