From 662b3b49ce836e14e4b34e2faac97d44e4f9f766 Mon Sep 17 00:00:00 2001 From: Mark Tucker Date: Thu, 22 Oct 2020 10:49:25 -0400 Subject: [PATCH] Return the thread limit stored in TBB instead of the local _threadLimit value when checking the max concurrency value. These two should be equal except in cases like running within Houdini where the TBB thread limit is set without explicitly telling USD that the value has been set. --- pxr/base/work/threadLimits.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pxr/base/work/threadLimits.cpp b/pxr/base/work/threadLimits.cpp index dff42f56a0..10cd9f1dda 100644 --- a/pxr/base/work/threadLimits.cpp +++ b/pxr/base/work/threadLimits.cpp @@ -31,6 +31,7 @@ #include #include +#include #include @@ -185,7 +186,7 @@ WorkSetConcurrencyLimitArgument(int n) unsigned WorkGetConcurrencyLimit() { - return _threadLimit; + return tbb::this_task_arena::max_concurrency(); } PXR_NAMESPACE_CLOSE_SCOPE