summaryrefslogtreecommitdiff
path: root/boost/asio/detail/signal_handler.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/asio/detail/signal_handler.hpp')
-rw-r--r--boost/asio/detail/signal_handler.hpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/boost/asio/detail/signal_handler.hpp b/boost/asio/detail/signal_handler.hpp
index edad41b8ee..6ea723a27a 100644
--- a/boost/asio/detail/signal_handler.hpp
+++ b/boost/asio/detail/signal_handler.hpp
@@ -16,10 +16,12 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
-#include <boost/asio/detail/addressof.hpp>
+#include <boost/asio/detail/bind_handler.hpp>
#include <boost/asio/detail/fenced_block.hpp>
#include <boost/asio/detail/handler_alloc_helpers.hpp>
#include <boost/asio/detail/handler_invoke_helpers.hpp>
+#include <boost/asio/detail/handler_work.hpp>
+#include <boost/asio/detail/memory.hpp>
#include <boost/asio/detail/signal_op.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -38,17 +40,19 @@ public:
: signal_op(&signal_handler::do_complete),
handler_(BOOST_ASIO_MOVE_CAST(Handler)(h))
{
+ handler_work<Handler>::start(handler_);
}
- static void do_complete(io_service_impl* owner, operation* base,
+ static void do_complete(void* owner, operation* base,
const boost::system::error_code& /*ec*/,
std::size_t /*bytes_transferred*/)
{
// Take ownership of the handler object.
signal_handler* h(static_cast<signal_handler*>(base));
ptr p = { boost::asio::detail::addressof(h->handler_), h, h };
+ handler_work<Handler> w(h->handler_);
- BOOST_ASIO_HANDLER_COMPLETION((h));
+ BOOST_ASIO_HANDLER_COMPLETION((*h));
// Make a copy of the handler so that the memory can be deallocated before
// the upcall is made. Even if we're not about to make an upcall, a
@@ -66,7 +70,7 @@ public:
{
fenced_block b(fenced_block::half);
BOOST_ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
- boost_asio_handler_invoke_helpers::invoke(handler, handler.handler_);
+ w.complete(handler, handler.handler_);
BOOST_ASIO_HANDLER_INVOCATION_END;
}
}