This code does not work:
cond_var[myID].wait(unique_lock<mutex>(mtx[myID])); The variable declaration is:
condition_variable cond_var[32]; mutex mtx[32]; This code does not work:
cond_var[myID].wait(unique_lock<mutex>(mtx[myID])); The variable declaration is:
condition_variable cond_var[32]; mutex mtx[32]; First, std::condition_variable::wait_for either two or three parameters .
Secondly, the first parameter std::condition_variable::wait_for is an lvalue-link. It cannot be tied to a temporary object.
This is what the compiler tells you.
What did you want to say, passing one argument there?
Source: https://ru.stackoverflow.com/questions/771772/
All Articles