MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / wait

Method wait

extern/boost/boost/thread/pthread/condition_variable.hpp:64–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62 }
63
64 inline void condition_variable::wait(unique_lock<mutex>& m)
65 {
66#if defined BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED
67 if(! m.owns_lock())
68 {
69 boost::throw_exception(condition_error(-1, "boost::condition_variable::wait() failed precondition mutex not owned"));
70 }
71#endif
72 int res=0;
73 {
74#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
75 thread_cv_detail::lock_on_exit<unique_lock<mutex> > guard;
76 detail::interruption_checker check_for_interruption(&internal_mutex,&cond);
77 pthread_mutex_t* the_mutex = &internal_mutex;
78 guard.activate(m);
79 res = posix::pthread_cond_wait(&cond,the_mutex);
80 check_for_interruption.unlock_if_locked();
81 guard.deactivate();
82#else
83 pthread_mutex_t* the_mutex = m.mutex()->native_handle();
84 res = posix::pthread_cond_wait(&cond,the_mutex);
85#endif
86 }
87#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
88 this_thread::interruption_point();
89#endif
90 if(res)
91 {
92 boost::throw_exception(condition_error(res, "boost::condition_variable::wait failed in pthread_cond_wait"));
93 }
94 }
95
96 // When this function returns true:
97 // * A notification (or sometimes a spurious OS signal) has been received

Callers 8

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

Calls 9

condition_errorFunction · 0.85
pthread_cond_waitFunction · 0.85
mutexMethod · 0.80
throw_exceptionFunction · 0.50
owns_lockMethod · 0.45
activateMethod · 0.45
unlock_if_lockedMethod · 0.45
deactivateMethod · 0.45
native_handleMethod · 0.45

Tested by

no test coverage detected