Community
cancel
Showing results for 
Search instead for 
Did you mean: 
P_A__Jimenez
Beginner
80 Views

tbb::mutex in object in vector causes critical error

I have some code that fills in a std::vector with some Job objects (std::vector). Each Job object has a tbb::mutex mMutexes[2]member. 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?

Thanks.
0 Kudos
1 Reply
Alexey_K_Intel3
Employee
80 Views

You are right in the assumption that mutexes should not be assigned or copied, andthat it should be disallowed. It can be considered a bug we need to fix.

Reply