I am putting some diagnostic console output statements in my code which uses TBB like
cout << "blah..blah..blah" << endl;
It is hard to read the results because the different threads are mixing their output on the console.
HOW DO I FIX THIS (IGNORING FOR THE MOMENT THE PERFORMANCE IMPACT)?
I tried to search the forum with no luck. I know in pthreads I could lock/unlock a section of code using a mutex. It is not clear how to do this in TBB.