You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Antonio Vieiro <an...@antonioshome.net> on 2011/09/20 10:01:43 UTC

Has been APR initialized?

Hi all,

Is there any way to know if APR has already been initialized? I'm
working on two modules that use APR, and I'd like any of this to
initialize/terminate APR in case of need.

Thanks in advance,
Antonio

Re: Has been APR initialized?

Posted by Antonio Vieiro <an...@antonioshome.net>.
Ah, so there's no harm in initializing APR several times. Yes, I think a 
short note in the docs should clarify that, I guess.

Thanks,
Antonio

El 20/09/11 21:44, Stefan Fritsch escribió:
> On Tuesday 20 September 2011, Antonio Vieiro wrote:
>> Is there any way to know if APR has already been initialized? I'm
>> working on two modules that use APR, and I'd like any of this to
>> initialize/terminate APR in case of need.
>
> Just call apr_initialize/apr_terminate in each modules. Only the first
> call to apr_initialize and the n-th call to apr_terminate will do
> something (if apr_initialize has been called n times). I guess this
> should be made clearer in the docs.


Re: Has been APR initialized?

Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Tuesday 20 September 2011, Antonio Vieiro wrote:
> Is there any way to know if APR has already been initialized? I'm
> working on two modules that use APR, and I'd like any of this to
> initialize/terminate APR in case of need.

Just call apr_initialize/apr_terminate in each modules. Only the first 
call to apr_initialize and the n-th call to apr_terminate will do 
something (if apr_initialize has been called n times). I guess this 
should be made clearer in the docs.