title: How do I get boost::condition::timed_wait to compile?
body: <p>I want to wait on a condition for up to 1 second. I've try passing in time_duration:</p>
  
  <pre><code>boost::posix_time::time_duration td = boost::posix_time::milliseconds(50);
  readerThread_cond_.timed_wait(lock, boost::bind(&amp;XXXX::writeCondIsMet, this), td);
  </code></pre>
  
  <p>but I get the error:</p>
  
  <blockquote>
    <p>/usr/include/boost/thread/pthread/condition_variable.hpp:156:
    error: no match for ‘operator+’ in
    ‘boost::get_system_time() +
    wait_duration’</p>
  </blockquote>
  
  <p>I've also tried passing a xtime:</p>
  
  <pre><code>boost::xtime t;
  boost::xtime_get(&amp;t, boost::TIME_UTC);
  readerThread_cond_.timed_wait(lock, boost::bind(&amp;XXXX::writeCondIsMet, this), td);
  </code></pre>
  
  <p>but I get the error:</p>
  
  <p>I'm linking with libboost_thread and libboost_date_time and the code compiles and run ok when I use just use wait, but the error message it seems to related to resolving the templates in the boost header files. It seems to be saying I am not passing in the right thing, but I just don't understand it.</p>