Je me demande ce que je fais mal ... avec un seul wait
il compile et fonctionne, mais pas avec un timed_wait
:état anonyme interprocessus Boost timed_wait pas compilable
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));
}
où obj->mutex
est un boost::interprocess::interprocess_mutex
et obj->condition
est un boost::interprocess::interprocess_condition
. Voici le g ++ journal d'erreur:
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)
alors que cela est le prototype de la fonction de membre de classe de condition (boost/interprocessus/synchronisation/interprocess_condition.hpp):
template <typename L, typename Pr>
bool timed_wait(L& lock, const boost::posix_time::ptime &abs_time, Pr pred)
(stimuler 1.40)