| 56 | } |
| 57 | |
| 58 | inline void condition_variable::wait(unique_lock<mutex>& m) |
| 59 | { |
| 60 | #if defined BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED |
| 61 | if(! m.owns_lock()) |
| 62 | { |
| 63 | boost::throw_exception(condition_error(-1, "boost::condition_variable::wait() failed precondition mutex not owned")); |
| 64 | } |
| 65 | #endif |
| 66 | int res=0; |
| 67 | { |
| 68 | #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS |
| 69 | thread_cv_detail::lock_on_exit<unique_lock<mutex> > guard; |
| 70 | detail::interruption_checker check_for_interruption(&internal_mutex,&cond); |
| 71 | guard.activate(m); |
| 72 | do { |
| 73 | res = pthread_cond_wait(&cond,&internal_mutex); |
| 74 | } while (res == EINTR); |
| 75 | #else |
| 76 | //boost::pthread::pthread_mutex_scoped_lock check_for_interruption(&internal_mutex); |
| 77 | pthread_mutex_t* the_mutex = m.mutex()->native_handle(); |
| 78 | do { |
| 79 | res = pthread_cond_wait(&cond,the_mutex); |
| 80 | } while (res == EINTR); |
| 81 | #endif |
| 82 | } |
| 83 | #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS |
| 84 | this_thread::interruption_point(); |
| 85 | #endif |
| 86 | if(res) |
| 87 | { |
| 88 | boost::throw_exception(condition_error(res, "boost::condition_variable::wait failed in pthread_cond_wait")); |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | inline bool condition_variable::do_wait_until( |
| 93 | unique_lock<mutex>& m, |
no test coverage detected