[Libreoffice-commits] core.git: sc/source
Stephan Bergmann
sbergman at redhat.com
Tue Oct 14 08:52:57 PDT 2014
sc/source/filter/oox/workbookfragment.cxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit b44b76746d8834a4c32f704273a8b7b7547a9328
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Oct 14 17:52:07 2014 +0200
Use C++11 std::thread::hardware_concurrency()
...and hope it gets past our various tinderboxes.
Change-Id: I4dd95e77c4a74ae58e66f98753fcf5e438080146
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 1ce4376..bacbc65 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -60,7 +60,9 @@
#include <salhelper/thread.hxx>
#include <osl/conditn.hxx>
+#include <algorithm>
#include <queue>
+#include <thread>
#include <boost/scoped_ptr.hpp>
#include <oox/ole/vbaproject.hxx>
@@ -296,7 +298,7 @@ public:
void importSheetFragments( WorkbookFragment& rWorkbookHandler, SheetFragmentVector& rSheets )
{
- sal_Int32 nThreads = std::min( rSheets.size(), (size_t) 4 /* FIXME: ncpus/2 */ );
+ sal_Int32 nThreads = std::min( rSheets.size(), (size_t) std::max(std::thread::hardware_concurrency(), 1U) );
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
More information about the Libreoffice-commits
mailing list