1 diff -u -r opencascade-7.5.0.orig/src/OSD/OSD_Parallel_TBB.cxx opencascade-7.5.0/src/OSD/OSD_Parallel_TBB.cxx
2 --- opencascade-7.5.0.orig/src/OSD/OSD_Parallel_TBB.cxx 2020-11-03 15:50:04.000000000 +0100
3 +++ opencascade-7.5.0/src/OSD/OSD_Parallel_TBB.cxx 2021-12-20 15:02:25.028915774 +0100
5 #include <tbb/parallel_for.h>
6 #include <tbb/parallel_for_each.h>
7 #include <tbb/blocked_range.h>
8 -#include <tbb/task_scheduler_init.h>
9 +#include <tbb/global_control.h>
10 Standard_ENABLE_DEPRECATION_WARNINGS
12 //=======================================================================
14 const FunctorInterface& theFunctor,
15 Standard_Integer theNbItems)
19 const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool();
20 const Standard_Integer aNbThreads = theNbItems > 0 ?
21 aThreadPool->NbDefaultThreadsToLaunch() : -1;
23 - tbb::task_scheduler_init aScheduler (aNbThreads);
24 + tbb::global_control(tbb::global_control::max_allowed_parallelism, aNbThreads);
25 tbb::parallel_for_each (theBegin, theEnd, theFunctor);
27 - catch (tbb::captured_exception& anException)
29 - throw Standard_ProgramError (anException.what());