summaryrefslogtreecommitdiff
path: root/boost/asio/detail/null_event.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/asio/detail/null_event.hpp')
-rw-r--r--boost/asio/detail/null_event.hpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/boost/asio/detail/null_event.hpp b/boost/asio/detail/null_event.hpp
index 28ba5ede55..3bc74afb68 100644
--- a/boost/asio/detail/null_event.hpp
+++ b/boost/asio/detail/null_event.hpp
@@ -16,9 +16,6 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
-
-#if !defined(BOOST_ASIO_HAS_THREADS)
-
#include <boost/asio/detail/noncopyable.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -76,7 +73,20 @@ public:
template <typename Lock>
void wait(Lock&)
{
+ do_wait();
}
+
+ // Timed wait for the event to become signalled.
+ template <typename Lock>
+ bool wait_for_usec(Lock&, long usec)
+ {
+ do_wait_for_usec(usec);
+ return true;
+ }
+
+private:
+ BOOST_ASIO_DECL static void do_wait();
+ BOOST_ASIO_DECL static void do_wait_for_usec(long usec);
};
} // namespace detail
@@ -85,6 +95,8 @@ public:
#include <boost/asio/detail/pop_options.hpp>
-#endif // !defined(BOOST_ASIO_HAS_THREADS)
+#if defined(BOOST_ASIO_HEADER_ONLY)
+# include <boost/asio/detail/impl/null_event.ipp>
+#endif // defined(BOOST_ASIO_HEADER_ONLY)
#endif // BOOST_ASIO_DETAIL_NULL_EVENT_HPP