[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn_config_t is not thread-safe

From: Stefan Fuhrmann <stefan.fuhrmann_at_wandisco.com>
Date: Mon, 3 Sep 2012 17:55:21 +0200

On Mon, Sep 3, 2012 at 2:19 PM, Joel Jirak <joel_at_jirak.us> wrote:

> Here's a patch that will fix the problem. It works by un-singletoning
> SVNConfig, so to speak. I'm not entirely satisfied with it because
> SVNConfig then has to be created many more times than necessary. It's
> more of a proof-of-concept, really.
>
> My initial attemp was to change SVNConfig::GetConfig() to return a
> copy of the config via apr_hash_copy, but this didn't work, presumably
> because apr_hash_copy() does a shallow copy. I think this direction
> is the cleaner way to go. Perhaps a true clone would work, but I
> don't have time to investigate this now.
>

Hi Joel,

Thanks for the analysis and sending a patch!
A quick review of the latter made me wonder:

--- SVN/SVNInfo.cpp (revision 23251)
> +++ SVN/SVNInfo.cpp (working copy)
> @@ -68,7 +68,7 @@
>
> #ifdef _MFC_VER
> // set up the configuration
> - m_pctx->config = SVNConfig::Instance().GetConfig();
> + m_pctx->config = (new SVNConfig())->GetConfig();
>

When will these two objects (SVNConfig and svn_config_t)
be deleted?

> // set up authentication
> m_prompt.Init(m_pool, m_pctx);
> #else
>

-- Stefan^2.

-- 
*
Join us this October at Subversion Live
2012<http://www.wandisco.com/svn-live-2012>
 for two days of best practice SVN training, networking, live demos,
committer meet and greet, and more! Space is limited, so get signed up
today<http://www.wandisco.com/svn-live-2012>
!
*
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=3003220
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2012-09-03 19:46:13 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.