
19 Aug
2012
19 Aug
'12
9:21 p.m.
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