posix_cond_variable_wait_for.cpp 556 B

123456789101112131415161718192021
  1. //
  2. // $Id$
  3. //
  4. #include<__vic/posix/cond_variable.h>
  5. #include<__vic/posix/time.h>
  6. namespace __vic { namespace posix {
  7. //----------------------------------------------------------------------------
  8. // Can depend on librt.a (clock_gettime) on Linux
  9. // therefore moved to the separate file
  10. bool cond_variable::wait_for(::pthread_mutex_t &m, unsigned long msec)
  11. {
  12. return wait_until(m,
  13. nanoseconds_since_epoch() + time_spec(msec, time_spec::msec));
  14. }
  15. //----------------------------------------------------------------------------
  16. }} // namespace