
On Tue, May 09, 2006 at 10:23:53PM +0000, Ryan Gallagher wrote:
I do like being able to write:
signal_registry::instance().register_handler(SIGINT, bind(&database_test_monitor::handle_interruption_and_exit, cref(*this), _1));
My ramblings on signals are on http://libcw.sourceforge.net/kernel/signals.html Did you read the first paragraph of that (2.1)? What I try to say there is that you can't expect to DO anything when a signal occurs. At most you can increment an atomic counter, and that's it. So, if you want an interface that allows call-backs (which I assume &database_test_monitor::handle_interruption_and_exit is), then that needs to be called later, when the application returns to the main loop. As a result, you can't think about making a (portable) interface for signals unless you provide that main loop - and that means, include timing and I/O for files, sockets, pipes etc (which is what libcw is). Anything simpler will make no sense imho. -- Carlo Wood <carlo@alinoe.com>