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

Re: A proposed solution for svn admin directory names

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-06-29 20:08:00 CEST

Joseph Galbraith <galb@vandyke.com> writes:

> Garrett Rooney wrote:
>> Static variables like that are not especially thread safe.
>
> Ahh... I think my second code snippet address this problem
> as it does away with the bool and only uses the szAdmDir...
> I'll quote it here for clarity:
>
> char* getadmdir()
> {
> static char* szAdmDir = 0;
> if ( szAdmDir == 0 )
> {

Pointers are probably atomic on all the platforms that run Subversion,
but strictly speaking it's not guaranteed and depends on the platform.

> szAdmDir = ::getenv("SVN_ADM_DIR");
> if ( szAdmDir == 0 )
> szAdmDir = ".svn";
> }
>
> return szAdmDir;
> }

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jun 29 20:08:58 2005

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

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