apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@ebuilt.com>
Subject Re: [PATCH] Allow unrelated SMSes to reset
Date Wed, 18 Jul 2001 15:01:40 GMT
On Wed, Jul 18, 2001 at 01:52:54PM +0200, Luke Kenneth Casson Leighton wrote:
> On Tue, Jul 17, 2001 at 05:49:08PM -0700, Justin Erenkrantz wrote:
> > Comments?  Would this make anyone happy?  =)
>  
> yes, funnily enough.
> 
> you intend this to be part of the sms 'utility' API, yes?
> a bit like apr_pool_cleanup_register_file() and socket() etc, yes?

I imagine that inside of the apr_thread_create function, this would be
called explicitly.  It would make the "real" parent the std SMS (aka
malloc/free) and then it would call this with the parent that was passed
into apr_thread_create to make sure that the thread SMS is reset (or
destroyed) when the parent is.

(Assuming something similiar to Aaron Bannert's patch to the thread API 
is accepted.  The current code in APR does not allow access to
apr_thread_t's pool.  That needs to be fixed before anyone can use the
pool/SMS inside of apr_thread_t.)  

> also, what happens if the child sms is *already part of the parent*?
> 
> can you guarantee that the registration and destruction of the
> sms, via cleanup, will not stuff the parent by effectively
> destroying the child sms twice?

Yup.  That's the catch.  It'd probably need to be a bit more
sophisticated than what I've posted OR make the apr_sms_reset a bit more
robust (i.e. handle SMSes that have already been cleaned up).  I'm
leaning towards making the apr_sms_reset more robust.  -- justin


Mime
View raw message