最初我是boost::mutex::scoped_lock
这样使用的(有效)
boost::mutex::scoped_lock lock(mutex_name);
condition.wait(lock); //where condition = boost::condition_variable
但是后来我将锁更改为以下不起作用
boost::lock_guard<boost::mutex> lock(mutex_name)
condition.wait(lock); //Error
有关如何解决问题的任何建议,我都会收到智能感知错误说明No instance of the overloaded function matches the argument list
。编译错误是
Error 7 error C2664: 'void boost::condition_variable::wait(boost::unique_lock<Mutex> &)' : cannot convert parameter 1 from 'boost::lock_guard<Mutex>' to 'boost::unique_lock<Mutex> &'