Lines Matching defs:target

37 namespace fibers {
52 condition_variable_any() = default;
54 ~condition_variable_any() {
58 condition_variable_any( condition_variable_any const&) = delete;
59 condition_variable_any & operator=( condition_variable_any const&) = delete;
63 void notify_all() noexcept;
65 template< typename LockType >
68 // atomically call lt.unlock() and block on *this
71 BOOST_ASSERT( ! active_ctx->wait_is_linked() );
74 // unlock external lt
77 active_ctx->suspend( lk);
80 lt.lock();
81 } catch (...) {
84 // post-conditions
88 template< typename LockType, typename Pred >
89 void wait( LockType & lt, Pred pred) {
95 template< typename LockType, typename Clock, typename Duration >
98 cv_status status = cv_status::no_timeout;
101 // store this fiber in waiting-queue
104 active_ctx->wait_link( wait_queue_);
108 // suspend this fiber
110 status = cv_status::timeout;
113 // remove from waiting-queue
116 lk.unlock();
117 }
120 lt.lock();
122 std::terminate();
125 BOOST_ASSERT( ! active_ctx->wait_is_linked() );
129 template< typename LockType, typename Clock, typename Duration, typename Pred >
131 std::chrono::time_point< Clock, Duration > const& timeout_time, Pred pred) {
134 return pred();
138 }
140 template< typename LockType, typename Rep, typename Period >
143 std::chrono::steady_clock::now() + timeout_duration);
146 template< typename LockType, typename Rep, typename Period, typename Pred >
149 std::chrono::steady_clock::now() + timeout_duration,
154 class BOOST_FIBERS_DECL condition_variable {
156 condition_variable_any cnd_;
159 condition_variable() = default;
161 condition_variable( condition_variable const&) = delete;
164 void notify_one() noexcept {
168 void notify_all() noexcept {
172 void wait( std::unique_lock< mutex > & lt) {
173 // pre-condition
174 BOOST_ASSERT( lt.owns_lock() );
176 cnd_.wait( lt);
177 // post-condition
179 BOOST_ASSERT( context::active() == lt.mutex()->owner_);
182 template< typename Pred >
185 BOOST_ASSERT( lt.owns_lock() );
188 // post-condition
189 BOOST_ASSERT( lt.owns_lock() );
193 template< typename Clock, typename Duration >
194 cv_status wait_until( std::unique_lock< mutex > & lt,
197 BOOST_ASSERT( lt.owns_lock() );
200 // post-condition
201 BOOST_ASSERT( lt.owns_lock() );
225 cv_status result = cnd_.wait_for( lt, timeout_duration);
228 BOOST_ASSERT( context::active() == lt.mutex()->owner_);
232 template< typename Rep, typename Period, typename Pred >
235 // pre-condition
236 BOOST_ASSERT( lt.owns_lock() );
238 bool result = cnd_.wait_for( lt, timeout_duration, pred);
241 BOOST_ASSERT( context::active() == lt.mutex()->owner_);
248 #ifdef _MSC_VER
249 # pragma warning(pop)
252 #ifdef BOOST_HAS_ABI_HEADERS
253 # include BOOST_ABI_SUFFIX
256 #endif // BOOST_FIBERS_CONDITION_VARIABLE_H