apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <mt...@apache.org>
Subject Re: Changing the order of cleanup for some core objects
Date Mon, 21 Jul 2008 11:12:13 GMT
Joe Orton wrote:
> 
> In the model where you have S allocated out of P, let's presume we also 
> have a subpool Q.
> 
> If for some reason specific to the design of your application, you need 
> S to be closed before the destruction of Q, you can register a cleanup 
> against Q which does calls apr_socket_close(S).  That will give defined 
> behaviour.
>

That's fine, but then if I explicitly close the S I have to deregister
the cleanup for Q, close the S, and then register the cleanup for Q
again. That's how its done now in multiple places where APR is used.
I need additional pool and additional cleanup for the exact behavior 
that pre_cleanup does. Also this pool has to be the 'last'
one registered, so adding any dependent child pools to P requires
deregister/register of Q so its assured it's callback is run first.

> The pre_cleanup stuff seems to be entirely redundant in this regard.  I 
> don't understand the motivation for it in the first place, to be honest.
> 

See above.

Regards
-- 
^(TM)

Mime
View raw message