summaryrefslogtreecommitdiff
path: root/sc/source/core/data/documen2.cxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-11-26 15:05:16 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-11-30 13:16:53 +0100
commit583b0612696f42571ac97b66c159570ea452fe17 (patch)
treee370a37e6a6ed6b019f8be78d62a676d89e0c7c5 /sc/source/core/data/documen2.cxx
parentaf361b464b46dcc39a1bb4ab098a6ddf6ff40a53 (diff)
add ThreadPool::isIdle() to avoid incorrect detection of "no tasks"
Tasks that are being worked on but are not yet finished are removed from maTasks, so maTasks.empty() does not mean "idle". I fixed one case already in 2ad4e77a0f266ae6e6fccaebb1d080d2880bdac3, this one fixes joinAll() which has a similar problem and triggers https://gerrit.libreoffice.org/c/core/+/69473/3/sc/source/core/data/documen2.cxx#312 Also rename joinAll() to joinThreadsIfIdle(), as that's what it really is. Change-Id: I8129cfadb81be968575ea8718de9ae997b877a4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106701 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/source/core/data/documen2.cxx')
-rw-r--r--sc/source/core/data/documen2.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 93d958f1b8ea..60f62ae6587b 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -325,7 +325,7 @@ ScDocument::~ScDocument()
OSL_PRECOND( !bInLinkUpdate, "bInLinkUpdate in dtor" );
// Join any pending(recalc) threads in global threadpool
- comphelper::ThreadPool::getSharedOptimalPool().joinAll();
+ comphelper::ThreadPool::getSharedOptimalPool().joinThreadsIfIdle();
bInDtorClear = true;