summaryrefslogtreecommitdiff
path: root/sc/source/core/data/documen8.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-09-29 11:04:17 +0300
committerDennis Francis <dennis.francis@collabora.co.uk>2017-11-21 16:09:42 +0530
commit9732f2b1588e2686f5bdec416972c1686289b635 (patch)
treece05fddf6e3c7d190d34c94bfc71202609f2fef7 /sc/source/core/data/documen8.cxx
parent973953bff0455c48b4ea43f6f4dd27778661eff3 (diff)
Re-work how the thread-specific data in ScDocument works
We can use normal thread_local data for it as a thread can only be acting on one ScDocument in parallelized formula group calculation anyway. Use separate data instance for the non-threaded data, and when a thread starts, copy that to the thread-specific data. Change-Id: I3e58320a728d1c5639a8a078748b3d4d7a451b25
Diffstat (limited to 'sc/source/core/data/documen8.cxx')
-rw-r--r--sc/source/core/data/documen8.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 7e31c2f6ab35..b29de4004c90 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -427,13 +427,20 @@ void ScDocument::SetFormulaResults(
pTab->SetFormulaResults(rTopPos.Col(), rTopPos.Row(), pResults, nLen);
}
-void ScDocument::CalculateInColumnInThread( const ScAddress& rTopPos, size_t nLen, unsigned nThisThread, unsigned nThreadsTotal)
+ScDocumentThreadSpecific ScDocument::CalculateInColumnInThread( const ScAddress& rTopPos, size_t nLen, unsigned nThisThread, unsigned nThreadsTotal)
{
ScTable* pTab = FetchTable(rTopPos.Tab());
if (!pTab)
- return;
+ return maNonThreaded;
+
+ assert(mbThreadedGroupCalcInProgress);
+ maThreadSpecific.SetupFromNonThreadedData(maNonThreaded);
pTab->CalculateInColumnInThread(rTopPos.Col(), rTopPos.Row(), nLen, nThisThread, nThreadsTotal);
+
+ assert(mbThreadedGroupCalcInProgress);
+
+ return maThreadSpecific;
}
void ScDocument::HandleStuffAfterParallelCalculation( const ScAddress& rTopPos, size_t nLen )