MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / wait

Method wait

include/win/boost/thread/pthread/condition_variable.hpp:58–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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,

Callers 15

lockMethod · 0.45
lock_sharedMethod · 0.45
lock_upgradeMethod · 0.45
lock_sharedMethod · 0.45
lockMethod · 0.45
lock_upgradeMethod · 0.45
lock_sharedMethod · 0.45
lockMethod · 0.45
lock_upgradeMethod · 0.45

Calls 6

condition_errorFunction · 0.85
activateMethod · 0.80
throw_exceptionFunction · 0.50
owns_lockMethod · 0.45
native_handleMethod · 0.45
mutexMethod · 0.45

Tested by

no test coverage detected