I have some code that fills in a std::vector with some Job objects (std::vector). Each Job object has a tbb::mutex mMutexesmember. No mutex is being used at all, yet. Thing is, once the vector goes out of scope, causing all Jobs to be destroyed, a Critical Error occurs pointing to internal_destroy() inside tbb::mutex's destructor.
Changing from tbb::mutex to tbb::spin_mutex does not cause any issues.
In case tbb::mutex cannot be assigned (as it may happen during a std::vector resize()), should not it be disallowed in the first place? In case it should work, do you have any ideas why that code causes such an error?