From dev-return-20771-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Thu Jul 17 10:37:36 2008 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 51701 invoked from network); 17 Jul 2008 10:37:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Jul 2008 10:37:36 -0000 Received: (qmail 41265 invoked by uid 500); 17 Jul 2008 10:37:35 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 41211 invoked by uid 500); 17 Jul 2008 10:37:35 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 41200 invoked by uid 99); 17 Jul 2008 10:37:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jul 2008 03:37:35 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.233.178.247] (HELO hs-out-0708.google.com) (64.233.178.247) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jul 2008 10:36:42 +0000 Received: by hs-out-0708.google.com with SMTP id h53so1745583hsh.11 for ; Thu, 17 Jul 2008 03:37:05 -0700 (PDT) Received: by 10.100.42.4 with SMTP id p4mr3806920anp.76.1216291025541; Thu, 17 Jul 2008 03:37:05 -0700 (PDT) Received: by 10.100.143.9 with HTTP; Thu, 17 Jul 2008 03:37:05 -0700 (PDT) Message-ID: Date: Thu, 17 Jul 2008 12:37:05 +0200 From: "Sander Striker" To: "Mladen Turk" Subject: Re: svn commit: r677505 - /apr/apr-util/trunk/misc/apr_reslist.c Cc: "Bojan Smojver" , dev@apr.apache.org In-Reply-To: <487F1E0A.2040102@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080717054557.AA2E02388A45@eris.apache.org> <20080717195057.213327svh8rbt1xc@www.rexursive.com> <487F1E0A.2040102@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Jul 17, 2008 at 12:25 PM, Mladen Turk wrote: > Bojan Smojver wrote: >> Quoting mturk@apache.org: >> >>> Use apr_pool_pre_cleanup_register for reslist cleanup >> >> After thinking about this a bit more, this patch may introduce a >> somewhat unusual (possibly even dangerous) behaviour, as it changes the >> way cleanups normally work with APR pools. >> > > It only forces calling resource destructors before > its subpools are destroyed. > The operation is exactly the same as if one would explicitly > call destructors for each resource before calling pool_destroy. > So the pool P is not destroyed before its subpools, only > the callback is called before subpools are destroyed. Yes, which is a difference in ordering, as this cleanup on the parent pool, is called prior to cleanups on all child pools. I can see what Bojan is getting at. > The standard cleanup on pool_clear(destroy) first destroys > all subpools and then call register cleanups. > This forces (just look at mod_proxy connection pool code) > the user to make some tricks so it can figure out weather > the destructor was called by invalidate or by pool destroy. > If it was by pool destroy then it must skip any subpool > destroy calls, because those would cause core. Cheers, Sander