Subject: [Boost-bugs] [Boost C++ Libraries] #4167: RFC: asio::io_service::async_stop() to handle signals
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-04-29 13:53:00
#4167: RFC: asio::io_service::async_stop() to handle signals
-----------------------------------+----------------------------------------
Reporter: giecrilj@⦠| Owner: chris_kohlhoff
Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: asio
Version: Boost 1.42.0 | Severity: Problem
Keywords: signal, event loop |
-----------------------------------+----------------------------------------
== Problem statement ==
asio::io_service has no way of stopping from within a signal handler.
Sending a signal to a daemon is a common way to controlling its behavior
(under POSIX).
Calling { io_service.stop(); } from a signal handler is not guaranteed to
be safe.
== Implementation suggestion ==
Declare and implement a public interface with the following semantics:
void io_service::async_stop(void);
/**
Sets an internal flag in io_service to stop at the nearest event loop.
May be called from a signal handler. */
== Known workarounds ==
Let the io_service listen to a pipe. Write to the pipe from within the
signal handler.
== References ==
<URL:http://article.gmane.org/gmane.comp.lib.boost.user/58164>
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4167> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC