Commit 84e5248b authored by Sujin Philip's avatar Sujin Philip Committed by Kitware Robot

Merge topic 'fix-vtkSMPThreadLocal-API'

b961d6d7 Fix vtkSMPThreadLocal API
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Will Schroeder's avatarWill Schroeder <will.schroeder@kitware.com>
Reviewed-by: Berk Geveci's avatarBerk Geveci <berk.geveci@kitware.com>
Merge-request: !651
parents fa56876c b961d6d7
...@@ -99,7 +99,7 @@ public: ...@@ -99,7 +99,7 @@ public:
// Constructor that allows the specification of an exemplar object // Constructor that allows the specification of an exemplar object
// which is used when constructing objects when Local() is first called. // which is used when constructing objects when Local() is first called.
// Note that a copy of the exemplar is created using its copy constructor. // Note that a copy of the exemplar is created using its copy constructor.
vtkSMPThreadLocal(const T& exemplar) : Count(0), Exemplar(exemplar) explicit vtkSMPThreadLocal(const T& exemplar) : Count(0), Exemplar(exemplar)
{ {
this->Initialize(); this->Initialize();
} }
...@@ -261,6 +261,10 @@ private: ...@@ -261,6 +261,10 @@ private:
{ {
return kaapi_get_self_kid(); return kaapi_get_self_kid();
} }
// disable copying
vtkSMPThreadLocal(const vtkSMPThreadLocal&);
void operator=(const vtkSMPThreadLocal&);
}; };
#endif #endif
// VTK-HeaderTest-Exclude: vtkSMPThreadLocal.h // VTK-HeaderTest-Exclude: vtkSMPThreadLocal.h
...@@ -51,7 +51,7 @@ public: ...@@ -51,7 +51,7 @@ public:
// Constructor that allows the specification of an exemplar object // Constructor that allows the specification of an exemplar object
// which is used when constructing objects when Local() is first called. // which is used when constructing objects when Local() is first called.
// Note that a copy of the exemplar is created using its copy constructor. // Note that a copy of the exemplar is created using its copy constructor.
vtkSMPThreadLocal(const T& exemplar) explicit vtkSMPThreadLocal(const T& exemplar)
: Backend(vtk::detail::smp::GetNumberOfThreads()), Exemplar(exemplar) : Backend(vtk::detail::smp::GetNumberOfThreads()), Exemplar(exemplar)
{ {
} }
...@@ -167,6 +167,10 @@ public: ...@@ -167,6 +167,10 @@ public:
private: private:
detail::ThreadSpecific Backend; detail::ThreadSpecific Backend;
T Exemplar; T Exemplar;
// disable copying
vtkSMPThreadLocal(const vtkSMPThreadLocal&);
void operator=(const vtkSMPThreadLocal&);
}; };
#endif #endif
......
...@@ -57,7 +57,8 @@ public: ...@@ -57,7 +57,8 @@ public:
// Constructor that allows the specification of an exemplar object // Constructor that allows the specification of an exemplar object
// which is used when constructing objects when Local() is first called. // which is used when constructing objects when Local() is first called.
// Note that a copy of the exemplar is created using its copy constructor. // Note that a copy of the exemplar is created using its copy constructor.
vtkSMPThreadLocal(const T& exemplar) : NumInitialized(0), Exemplar(exemplar) explicit vtkSMPThreadLocal(const T& exemplar)
: NumInitialized(0), Exemplar(exemplar)
{ {
this->Initialize(); this->Initialize();
} }
...@@ -217,6 +218,10 @@ private: ...@@ -217,6 +218,10 @@ private:
{ {
return 0; return 0;
} }
// disable copying
vtkSMPThreadLocal(const vtkSMPThreadLocal&);
void operator=(const vtkSMPThreadLocal&);
}; };
#endif #endif
// VTK-HeaderTest-Exclude: vtkSMPThreadLocal.h // VTK-HeaderTest-Exclude: vtkSMPThreadLocal.h
...@@ -104,7 +104,7 @@ public: ...@@ -104,7 +104,7 @@ public:
// Constructor that allows the specification of an exemplar object // Constructor that allows the specification of an exemplar object
// which is used when constructing objects when Local() is first called. // which is used when constructing objects when Local() is first called.
// Note that a copy of the exemplar is created using its copy constructor. // Note that a copy of the exemplar is created using its copy constructor.
vtkSMPThreadLocal(const T& exemplar) : Count(0), Exemplar(exemplar) explicit vtkSMPThreadLocal(const T& exemplar) : Count(0), Exemplar(exemplar)
{ {
this->Initialize(); this->Initialize();
} }
...@@ -260,6 +260,10 @@ private: ...@@ -260,6 +260,10 @@ private:
{ {
return vtkSMPToolsGetThreadID(); return vtkSMPToolsGetThreadID();
} }
// disable copying
vtkSMPThreadLocal(const vtkSMPThreadLocal&);
void operator=(const vtkSMPThreadLocal&);
}; };
#endif #endif
// VTK-HeaderTest-Exclude: vtkSMPThreadLocal.h // VTK-HeaderTest-Exclude: vtkSMPThreadLocal.h
...@@ -98,7 +98,7 @@ public: ...@@ -98,7 +98,7 @@ public:
// Constructor that allows the specification of an exemplar object // Constructor that allows the specification of an exemplar object
// which is used when constructing objects when Local() is first called. // which is used when constructing objects when Local() is first called.
// Note that a copy of the exemplar is created using its copy constructor. // Note that a copy of the exemplar is created using its copy constructor.
vtkSMPThreadLocal(const T& exemplar) : Internal(exemplar) explicit vtkSMPThreadLocal(const T& exemplar) : Internal(exemplar)
{ {
} }
...@@ -194,6 +194,10 @@ public: ...@@ -194,6 +194,10 @@ public:
private: private:
TLS Internal; TLS Internal;
// disable copying
vtkSMPThreadLocal(const vtkSMPThreadLocal&);
void operator=(const vtkSMPThreadLocal&);
}; };
#endif #endif
// VTK-HeaderTest-Exclude: vtkSMPThreadLocal.h // VTK-HeaderTest-Exclude: vtkSMPThreadLocal.h
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment