You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Justin Erenkrantz <je...@apache.org> on 2002/07/19 23:25:13 UTC
Re: cvs commit: apr/test testthread.c
On Fri, Jul 19, 2002 at 05:49:24PM -0000, bnicholes@apache.org wrote:
> @@ -186,6 +186,8 @@
> }
> printf("OK\n");
>
> + apr_terminate();
> +
> return 0;
> }
The proper thing to do is:
atexit(apr_terminate);
at the beginning of the program (notably near the apr_initialize
call). -- justin
Re: cvs commit: apr/test testthread.c
Posted by Aaron Bannert <aa...@clove.org>.
On Fri, Jul 19, 2002 at 02:25:13PM -0700, Justin Erenkrantz wrote:
> On Fri, Jul 19, 2002 at 05:49:24PM -0000, bnicholes@apache.org wrote:
> > @@ -186,6 +186,8 @@
> > }
> > printf("OK\n");
> >
> > + apr_terminate();
> > +
> > return 0;
> > }
>
> The proper thing to do is:
>
> atexit(apr_terminate);
>
> at the beginning of the program (notably near the apr_initialize
> call). -- justin
That's not what httpd does. OTOH APR's test and httpd's support binaries
do register the atexit call. So what's the right way to do this and
what kinds of problems can we expect from the atexit() version?
Ryan and I were just having this discussion the other day regarding
SIGINT from a Ctrl-C keypress from many shells. The feeling was that
we wouldn't expect the cleanups to run for SIGINT, since we don't
(or shouldn't be) catching that signal in Apache. Is this incorrect?
-aaron