1
我不知道我做錯了什麼?用它編譯唯一wait
和運行,但不與timed_wait
:升壓進程間匿名條件TIMED_WAIT未編譯
using boost::interprocess::scoped_lock;
using boost::interprocess::interprocess_mutex;
using boost::posix_time::milliseconds;
[...]
scoped_lock<interprocess_mutex> lock(obj->mutex);
while (...) {
obj->condition.timed_wait(lock, milliseconds(100));
}
obj->mutex
哪裏是boost::interprocess::interprocess_mutex
和obj->condition
是boost::interprocess::interprocess_condition
。這裏是G ++錯誤日誌:
code.cpp: In member function ‘[...]’:
code.cpp:42: error: no matching function for call to ‘boost::interprocess::interprocess_condition::timed_wait(boost::interprocess::scoped_lock<boost::interprocess::interprocess_mutex>&, boost::posix_time::milliseconds)
而這是條件類的成員函數的原型(升壓/間/同步/ interprocess_condition.hpp):
template <typename L, typename Pr>
bool timed_wait(L& lock, const boost::posix_time::ptime &abs_time, Pr pred)
(升壓1.40)