11 #ifndef ASIO_DETAIL_WIN_EVENT_HPP 12 #define ASIO_DETAIL_WIN_EVENT_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 20 #if defined(ASIO_WINDOWS) 42 template <
typename Lock>
43 void signal(Lock& lock)
45 this->signal_all(lock);
49 template <
typename Lock>
50 void signal_all(Lock& lock)
55 ::SetEvent(events_[0]);
59 template <
typename Lock>
60 void unlock_and_signal_one(Lock& lock)
64 bool have_waiters = (state_ > 1);
67 ::SetEvent(events_[1]);
71 template <
typename Lock>
72 bool maybe_unlock_and_signal_one(Lock& lock)
79 ::SetEvent(events_[1]);
86 template <
typename Lock>
87 void clear(Lock& lock)
91 ::ResetEvent(events_[0]);
92 state_ &= ~
std::size_t(1);
96 template <
typename Lock>
100 while ((state_ & 1) == 0)
104 ::WaitForMultipleObjects(2, events_,
false, INFINITE);
120 #if defined(ASIO_HEADER_ONLY) 122 #endif // defined(ASIO_HEADER_ONLY) 124 #endif // defined(ASIO_WINDOWS) 126 #endif // ASIO_DETAIL_WIN_EVENT_HPP #define ASIO_ASSERT(expr)