Boost logo

Boost Users :

Subject: Re: [Boost-users] AsIO daytime example needs terminate code
From: Boris Schaeling (boris_at_[hidden])
Date: 2010-04-29 08:56:47


On Thu, 29 Apr 2010 10:19:59 +0200, Christopher Yeleighton
<giecrilj_at_[hidden]> wrote:

> [...]May I call socket::cancel in a signal handler?
> How do I dispose of the open session objects?

You may only call async-signal-safe functions in a signal handler (there
is a list of those functions at
<http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html>).
As the documentation of Boost.Asio doesn't mention signal handlers (as far
as I know), I wouldn't assume that it's safe to call any Boost.Asio
function in a signal handler (this is only safe if the implementation of a
Boost.Asio function only calls async-signal-safe functions; but then an
implementation can change in a new version). Maybe you can propose (or
create?) a stop function which is safe to call in a signal handler (sounds
like a good contribution to Boost.Asio)?

Boris


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net