From dev-return-23563-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Tue Oct 12 12:49:03 2010 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 49706 invoked from network); 12 Oct 2010 12:49:02 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Oct 2010 12:49:02 -0000 Received: (qmail 38483 invoked by uid 500); 12 Oct 2010 12:49:02 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 38030 invoked by uid 500); 12 Oct 2010 12:48:59 -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 38016 invoked by uid 99); 12 Oct 2010 12:48:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Oct 2010 12:48:58 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [213.191.128.81] (HELO mxout2.iskon.hr) (213.191.128.81) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Oct 2010 12:48:51 +0000 Received: from mxscanout.iskon.hr (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id A0AE0CB05E for ; Tue, 12 Oct 2010 14:48:28 +0200 (CEST) Received: from mx.iskon.hr (unknown [213.191.142.124]) by mxscanout.iskon.hr (Postfix) with SMTP id 6DED4CB038 for ; Tue, 12 Oct 2010 14:48:28 +0200 (CEST) Received: (qmail 13729 invoked from network); 12 Oct 2010 14:48:28 +0200 X-AVScan: ClamAV X-Remote-IP: 89.164.4.207 Received: from 4-207.dsl.iskon.hr (HELO es55x86w0.jboss.hr) (89.164.4.207) by mx.iskon.hr with SMTP; 12 Oct 2010 14:48:28 +0200 Message-ID: <4CB45926.7020901@apache.org> Date: Tue, 12 Oct 2010 14:48:38 +0200 From: Mladen Turk User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100915 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: dev@apr.apache.org Subject: Re: Questions about apr_initialize(), apr_terminate() References: <20101012104531.GA10582@tomas> In-Reply-To: <20101012104531.GA10582@tomas> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: IskonProtect X-PerlMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, BODY_SIZE_800_899 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' On 10/12/2010 12:45 PM, tomas@tuxteam.de wrote: > > Thus, it would seem safe to call apr_initialize from each extension - > I'd just have to make sure that the calls are balanced. Is that right? > Exactly. You can call it as many times as you wish. Making sure the number of calls match. > Another question: what is the difference between apr_terminate() and > apr_terminate2()? I didn't understand the remark in the docs [1] > None for unix, but for windows, apr_terminate is _cdecl, and apr_terminate2 is _stdcall. It means you can use apr_terminate in something like atexit(apr_terminate) (atexit in windows requires _cdecl calling convention) even from .dll version of APR. apr_terminate2 uses _stdacall convention meaning you can use it from interpreters (or loading via LoadLibrary/dload) which needs standard calling convention. Regards -- ^TM