[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Allocating from a pool in cleanup

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-11-11 12:28:46 CET

Greg Stein <gstein@lyra.org> writes:

> > The problem is registering cleanups in a pool in the process of being
> > cleaned up. Opening files, like a lot of other APR operations, registers
> > a cleanup with the pool being passed in. It probably wouldn't even be that
> > hard to allow registering cleanups during cleanup; I'll look into that.
> Set pool->cleanups to NULL before running them. After you're done running
> them, run again if cleanups != NULL. Note the potential for an infinite
> loop... :-)

I don't think that runs the cleanups in the ideal order. Given two
cleanups cleanupA and cleanupB, with cleanupA run before cleanupB,
then if cleanupA registers cleanupC I would expect cleanupC to run
before cleanupB. Each cleanup that is registered goes to the head of
the queue.

What about allowing the creation of subpools during a cleanup handler
as well? Just clear any subpools created by running a handler before
running the next, possibly newly added, handler :)

Philip Martin
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Nov 11 12:29:34 2002

This is an archived mail posted to the Subversion Dev mailing list.