|
Boost : |
Subject: Re: [boost] Boost.Process 0.5 released
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2012-08-19 17:21:00
How is asynch. signal handling done?
int status; boost::asio::signal_set set(io_service, SIGCHLD);
set.async_wait( [&status](const boost::system::error_code&, int) {
::wait(&status); } );
Please note that on POSIX you are limited on what you can do inside a
signal handler (must not call non-reentrant functions)!
I suggest you do not invoke the callback from the user in the signal
handler - instead you set inside the signal handler a flag indicating
the io-demultiplexer (io_service) to call the associated callback if you
have returned from the signal handler (io_service has to continue with
dispatching).
Oliver
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk