Question: What will be the possible outputs for the following program? #include #include #include using namespace std; mutex m 1 ; mutex m 2 ; void

What will be the possible outputs for the following program?
#include
#include
#include
using namespace std;
mutex m1;
mutex m2;
void funcB(){
unique_lock l(m1);
for (int i =6; i <9; i++){
if (i ==8)
return;
cout << i;
}
}
int main(){
thread th3(funcB);
thread th4(funcB);
th3.join();
th4.join();
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!