2 // detail/null_event.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_ASIO_DETAIL_NULL_EVENT_HPP
12 #define BOOST_ASIO_DETAIL_NULL_EVENT_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
19 #include <boost/asio/detail/noncopyable.hpp>
21 #include <boost/asio/detail/push_options.hpp>
41 // Signal the event. (Retained for backward compatibility.)
42 template <typename Lock>
47 // Signal all waiters.
48 template <typename Lock>
49 void signal_all(Lock&)
53 // Unlock the mutex and signal one waiter.
54 template <typename Lock>
55 void unlock_and_signal_one(Lock&)
59 // Unlock the mutex and signal one waiter who may destroy us.
60 template <typename Lock>
61 void unlock_and_signal_one_for_destruction(Lock&)
65 // If there's a waiter, unlock the mutex and signal it.
66 template <typename Lock>
67 bool maybe_unlock_and_signal_one(Lock&)
73 template <typename Lock>
78 // Wait for the event to become signalled.
79 template <typename Lock>
85 // Timed wait for the event to become signalled.
86 template <typename Lock>
87 bool wait_for_usec(Lock&, long usec)
89 do_wait_for_usec(usec);
94 BOOST_ASIO_DECL static void do_wait();
95 BOOST_ASIO_DECL static void do_wait_for_usec(long usec);
102 #include <boost/asio/detail/pop_options.hpp>
104 #if defined(BOOST_ASIO_HEADER_ONLY)
105 # include <boost/asio/detail/impl/null_event.ipp>
106 #endif // defined(BOOST_ASIO_HEADER_ONLY)
108 #endif // BOOST_ASIO_DETAIL_NULL_EVENT_HPP