Return-Path: X-Original-To: apmail-subversion-dev-archive@minotaur.apache.org Delivered-To: apmail-subversion-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3690FDAE9 for ; Tue, 4 Sep 2012 19:07:52 +0000 (UTC) Received: (qmail 89200 invoked by uid 500); 4 Sep 2012 19:07:51 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 89159 invoked by uid 500); 4 Sep 2012 19:07:51 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Received: (qmail 89151 invoked by uid 99); 4 Sep 2012 19:07:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2012 19:07:51 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of brane@wandisco.com designates 209.85.214.43 as permitted sender) Received: from [209.85.214.43] (HELO mail-bk0-f43.google.com) (209.85.214.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2012 19:07:45 +0000 Received: by bkty15 with SMTP id y15so4220333bkt.16 for ; Tue, 04 Sep 2012 12:07:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:organization:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding:x-gm-message-state; bh=QGbhI7G6entpLWdYIPqL7UtHVUI06dqFri3GDp1kHsw=; b=GkNO7heyT7qSKAgIBamq6JNL2y9TeADzmHHMCn+QOy+dBPsvek/HxKsr31eNNYB0z2 D4F+JIlk0fEu+WDttk/FAtthAMi/m/qcnE3EOIdoNINsas1ZFDQQRS+sRfMTTJcMEXlZ X7Z4CF41PJyZef1DCn/NuiBYc1D+Ps8hpeylcn9DKt1HGL/EP3ykyo/1pHzTttSvM+JU 1hhVFgHwn7VRHbgPZckhKfurGCajwVS4YLJMG1Uf1kOajhUZrFwAI/JsnFqtxPGV8d+e eYbl8rvjoHtxn5aYbDWDHKPMCIhV431FYkqfJ4a4+o0EOedl/8wUFaalKnlrK7wHN+bU FADw== Received: by 10.204.157.10 with SMTP id z10mr8804927bkw.63.1346785643516; Tue, 04 Sep 2012 12:07:23 -0700 (PDT) Received: from zulu.local (cpe-46-164-2-55.dynamic.amis.net. [46.164.2.55]) by mx.google.com with ESMTPS id hg13sm11250513bkc.7.2012.09.04.12.07.21 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Sep 2012 12:07:22 -0700 (PDT) Message-ID: <50465168.3040008@wandisco.com> Date: Tue, 04 Sep 2012 21:07:20 +0200 From: =?UTF-8?B?QnJhbmtvIMSMaWJlag==?= Organization: WANdisco User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: dev@subversion.apache.org Subject: Re: thread safe References: <5044FB5F.1080309@gmail.com> <50450EE1.50002@wandisco.com> <50451025.1050202@gmail.com> <50451130.5060508@wandisco.com> <50463B50.3030002@gmail.com> <50464913.8010906@wandisco.com> <50464B99.6000703@gmail.com> In-Reply-To: <50464B99.6000703@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Gm-Message-State: ALoCoQntSCwnWIlU3VlGhXtPYjgfQp+cH3l1taA9rlrbM3K9PNy8WlAqPJkfzFCDttVAUMQhpuap X-Virus-Checked: Checked by ClamAV on apache.org On 04.09.2012 20:42, Stefan Küng wrote: > Seems I got confused here: > What we have to pass to almost each svn API is the config hash for the > svn_client_ctx_t struct. That's what I need a copy of. The svn_config_* functions work with svn_config_t object. The tmp_key and tmp_value fields in those object are in fact the ones that prevent you from reading the same svn_config_t from multiple threads without synchronization. > And as Bert already noticed: apr_hash_copy only does a shallow copy, > not a deep copy. Seems I have to iterate over the hash and copy every > item separately. That is correct. You'll also have to duplicate the svn_config_t structure itself, I think that essentially means doing an svn_config_create and copying over "x_values" and "section_names_case_sensitive"; and, of course, doing the deep copy of "sections". If you do the deep copy properly -- i.e., copying the keys and values into the new config_t's pool as well as the hashes -- then you'll save yourself a bit of trouble with pool lifetimes, too. > I'll do that first in TSVN, then do some tests. > After that I can use that code to create an svn_config_dup() API if > still required. Why not just write svn_config_dup in libsvn_subr/config.c? Surely there's no reason to keep this functionality out of the core libraries. -- Brane -- Certified & Supported Apache Subversion Downloads: http://www.wandisco.com/subversion/download