-
Improvement
-
Resolution: Done
-
Medium
-
None
Currently, the copy constructor of an AttributeArray is not thread-safe because it doesn't lock the mutex when initializing the variables around performing the copy.
The best pattern I've found to address this is the following:
class Foo { private: Foo(const Foo& other, const tbb::spin_mutex::scoped_lock&) : var(other.var) { } public: Foo(const Foo& other) : Foo(other, tbb::spin_mutex::scoped_lock(other.mMutex)) { } };
However, this requires an ABI=7 change.