私は何が間違っているのか疑問に思っています...ソール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)
これは条件クラスのメンバー関数 (boost/interprocess/sync/interprocess_condition.hpp) のプロトタイプです。
template <typename L, typename Pr>
bool timed_wait(L& lock, const boost::posix_time::ptime &abs_time, Pr pred)
(ブースト 1.40)