diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2019-03-20 20:07:58 +0530 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-03-21 11:24:26 +0100 |
commit | 769832cc1f592b1d0c39cda7795fe4548fc97566 (patch) | |
tree | 404546dfca76bc766ad88fcf9fe8f3cb5f7ad3f1 /sc/source/core/data/documen2.cxx | |
parent | 3d9f973e6648c5819608237f390df523b6a32ed8 (diff) |
Increase the life-cycle of threads in thread-pool...
to ScDocument lifetime if possible. This helps to avoid lots
of thread setup-cost while doing recalcs especially if there are
many formula-groups in the document and most of them are fairly
light-weight.
Change-Id: Idd57e1ebd0d4e492f99e31237d4a55ec9c95a121
Reviewed-on: https://gerrit.libreoffice.org/69473
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc/source/core/data/documen2.cxx')
-rw-r--r-- | sc/source/core/data/documen2.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 321c4535e10b..0892025b242a 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -32,6 +32,7 @@ #include <tools/urlobj.hxx> #include <rtl/crc.h> #include <basic/basmgr.hxx> +#include <comphelper/threadpool.hxx> #include <sal/log.hxx> #include <document.hxx> @@ -307,6 +308,9 @@ ScDocument::~ScDocument() { OSL_PRECOND( !bInLinkUpdate, "bInLinkUpdate in dtor" ); + // Join any pending(recalc) threads in global threadpool + comphelper::ThreadPool::getSharedOptimalPool().joinAll(); + bInDtorClear = true; // first of all disable all refresh timers by deleting the control |