diff --git a/include/Gaffer/Plug.h b/include/Gaffer/Plug.h index 9be15c114be..f37954adfca 100644 --- a/include/Gaffer/Plug.h +++ b/include/Gaffer/Plug.h @@ -277,6 +277,7 @@ class GAFFER_API Plug : public GraphComponent friend class DirtyPropagationScope; class DirtyPlugs; + static thread_local DirtyPlugs g_localDirtyPlugs; Direction m_direction; Plug *m_input; diff --git a/src/Gaffer/Plug.cpp b/src/Gaffer/Plug.cpp index 5de181e1cdd..81d2556e3fa 100644 --- a/src/Gaffer/Plug.cpp +++ b/src/Gaffer/Plug.cpp @@ -809,12 +809,6 @@ class Plug::DirtyPlugs } } - static DirtyPlugs &local() - { - static tbb::enumerable_thread_specific g_dirtyPlugs; - return g_dirtyPlugs.local(); - } - private : // We use this graph structure to keep track of the dirty propagation. @@ -967,25 +961,27 @@ class Plug::DirtyPlugs }; +thread_local Plug::DirtyPlugs Plug::g_localDirtyPlugs; + void Plug::propagateDirtiness( Plug *plugToDirty ) { DirtyPropagationScope scope; - DirtyPlugs::local().insert( plugToDirty ); + g_localDirtyPlugs.insert( plugToDirty ); } void Plug::pushDirtyPropagationScope() { - DirtyPlugs::local().pushScope(); + g_localDirtyPlugs.pushScope(); } void Plug::popDirtyPropagationScope() { - DirtyPlugs::local().popScope(); + g_localDirtyPlugs.popScope(); } void Plug::flushDirtyPropagationScope() { - DirtyPlugs::local().flush(); + g_localDirtyPlugs.flush(); } void Plug::dirty()