11 #ifndef ASIO_DETAIL_POSIX_EVENT_HPP 12 #define ASIO_DETAIL_POSIX_EVENT_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 20 #if defined(ASIO_HAS_PTHREADS) 41 ::pthread_cond_destroy(&cond_);
45 template <
typename Lock>
46 void signal(Lock& lock)
48 this->signal_all(lock);
52 template <
typename Lock>
53 void signal_all(Lock& lock)
58 ::pthread_cond_broadcast(&cond_);
62 template <
typename Lock>
63 void unlock_and_signal_one(Lock& lock)
67 bool have_waiters = (state_ > 1);
70 ::pthread_cond_signal(&cond_);
74 template <
typename Lock>
75 bool maybe_unlock_and_signal_one(Lock& lock)
82 ::pthread_cond_signal(&cond_);
89 template <
typename Lock>
90 void clear(Lock& lock)
94 state_ &= ~
std::size_t(1);
98 template <
typename Lock>
102 while ((state_ & 1) == 0)
105 ::pthread_cond_wait(&cond_, &lock.mutex().mutex_);
111 ::pthread_cond_t cond_;
120 #if defined(ASIO_HEADER_ONLY) 122 #endif // defined(ASIO_HEADER_ONLY) 124 #endif // defined(ASIO_HAS_PTHREADS) 126 #endif // ASIO_DETAIL_POSIX_EVENT_HPP #define ASIO_ASSERT(expr)