apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <mt...@apache.org>
Subject Re: Multiple use of apr_initialize, apr_pool_create_ex and apr_dbm_open_ex
Date Mon, 23 Aug 2010 17:32:05 GMT
On 08/23/2010 04:53 PM, Christian K. wrote:
> Hello,
>
>
> In this application I want to write a dbm file, to use for HTTPD
> authentication. Since I do not want to make any assumption on the
> initialization state of apr I would like to repeatedly initialize and
> terminate apr.

IMHO this is API misuse.
It's not a problem if you call apr_initialize or apr_terminate
multiple times, since only the first and last will actually
do the job (although they are not thread safe).
However apr_terminate is meant to be used at process exit
as a top level cleanup.

See:
http://apr.apache.org/docs/apr/1.4/group__apr__library.html

It clearly states that apr_initialize/apr_terminate should be
used as entry and exit point to the *library* (which usually
translates to a single calls per process life time)


Regards
-- 
^TM

Mime
View raw message