Support oneTBB 2021 Index: opensubdiv/osd/tbbEvaluator.cpp --- opensubdiv/osd/tbbEvaluator.cpp.orig +++ opensubdiv/osd/tbbEvaluator.cpp @@ -25,7 +25,8 @@ #include "../osd/tbbEvaluator.h" #include "../osd/tbbKernel.h" -#include +#define TBB_PREVIEW_GLOBAL_CONTROL true +#include namespace OpenSubdiv { namespace OPENSUBDIV_VERSION { @@ -215,10 +216,11 @@ TbbEvaluator::Synchronize(void *) { /* static */ void TbbEvaluator::SetNumThreads(int numThreads) { - if (numThreads == -1) { - tbb::task_scheduler_init init; - } else { - tbb::task_scheduler_init init(numThreads); + if (numThreads != -1) { + tbb::global_control tbb_global_control( + tbb::global_control::max_allowed_parallelism, + numThreads + ); } }