void-packages/srcpkgs/OpenSubdiv/patches/tbb-2021.patch

30 lines
814 B
Diff
Raw Normal View History

2022-01-28 00:18:47 +00:00
diff --git a/opensubdiv/osd/tbbEvaluator.cpp b/opensubdiv/osd/tbbEvaluator.cpp
index c98db9f..8dec0e1 100644
--- a/opensubdiv/osd/tbbEvaluator.cpp
+++ b/opensubdiv/osd/tbbEvaluator.cpp
@@ -25,7 +25,7 @@
#include "../osd/tbbEvaluator.h"
#include "../osd/tbbKernel.h"
-#include <tbb/task_scheduler_init.h>
+#include <tbb/global_control.h>
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
@@ -215,10 +215,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
+ );
}
}