httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garrett Rooney <roo...@electricjellyfish.net>
Subject Re: APR cross-platform signal semantics
Date Sun, 05 Feb 2006 06:12:30 GMT
On 2/4/06, Nick Kew <nick@webthing.com> wrote:
> Historically, different platforms have different signal semantics.
>
> I need to set up a signal handler.  The primary targets are
> Linux and Solaris, but I'd much prefer cross-platform.  And I'd
> like it to be MPM-agnostic in httpd, though the prime target
> is Worker.
>
> Is the following correct and complete for APR signals
> to function across platforms?
>
> static void my_handler(int signum) {
>   apr_signal_block(signum) ;
>   /* do things */
>   apr_signal_unblock(signum) ;
> }
>
> static void my_child_init(args) {
>   apr_signal(MY_SIGNAL, my_handler);
> }

That seems reasonable to me, although I suspect the behavior with
regard to how signals interact with threads will vary from system to
system, although apr_setup_signal_thread seems relevant to that part
of the problem...

-garrett

Mime
View raw message