Joe Orton
Mon, 21 Jul 2008 06:34:55 -0700
On Mon, Jul 21, 2008 at 01:12:13PM +0200, Mladen Turk wrote: > 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. So you're saying it is possible to achieve the desired behaviour with APR today, but it's a bit of effort? Why can't you encapsulate that effort in a couple of (AFAICT trivial two-line) wrapper functions? You have to make a case why it is necessary to change the default behaviour of APR objects. I'm not seeing that; I'm not seeing why the next guy who comes along couldn't write their app in such a way that it'd be more convenient for APR sockets to be destroyed before the pre-cleanup phase, and require a pre-pre-cleanup phase to make things a bit easier for them. (this argument applies to the existence of the pre-cleanup phase itself, too) joe