diff -u -r opencascade-7.5.0.orig/src/OSD/OSD_Parallel_TBB.cxx opencascade-7.5.0/src/OSD/OSD_Parallel_TBB.cxx --- opencascade-7.5.0.orig/src/OSD/OSD_Parallel_TBB.cxx 2020-11-03 15:50:04.000000000 +0100 +++ opencascade-7.5.0/src/OSD/OSD_Parallel_TBB.cxx 2021-12-20 15:02:25.028915774 +0100 @@ -25,7 +25,7 @@ #include #include #include -#include +#include Standard_ENABLE_DEPRECATION_WARNINGS //======================================================================= @@ -38,19 +38,12 @@ const FunctorInterface& theFunctor, Standard_Integer theNbItems) { - try - { const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool(); const Standard_Integer aNbThreads = theNbItems > 0 ? aThreadPool->NbDefaultThreadsToLaunch() : -1; - tbb::task_scheduler_init aScheduler (aNbThreads); + tbb::global_control(tbb::global_control::max_allowed_parallelism, aNbThreads); tbb::parallel_for_each (theBegin, theEnd, theFunctor); - } - catch (tbb::captured_exception& anException) - { - throw Standard_ProgramError (anException.what()); - } } #endif /* HAVE_TBB */