[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: Jonathan Malek <jonathan.malek_at_gmail.com>
Date: 2005-06-30 01:44:33 CEST

I may have read it wrong, but I thought apr used pthread.h? It may be
that's not the pthread library I know...

On 6/29/05, Garrett Rooney <rooneg@electricjellyfish.net> wrote:
> Jonathan Malek wrote:
>
> > As to (2), we could use pthread (used by apr) and something like:
> >
> > pthread_mutex_t svn_admin_dir_mutex = PTHREAD_MUTEX_INITIALIZER ;
> >
> > char * getadmdir()
> > {
> > static char * szAdmDir = 0 ;
> >
> > pthread_mutex_lock( &svn_admin_dir_mutex ) ;
> > if( szAdmDir == 0 )
> > {
> > szAdmDir = getenv( "SVN_ADM_DIR" ) ;
> > if( szAdmDir == 0 )
> > szAdmDir = ".svn" ;
> > }
> > pthread_mutex_unlock( &svn_admin_dir_mutex ) ;
> >
> > return szAdmDir ;
> > }
>
> Actually, APR mutexes don't have static initializers like pthread
> mutexes, so you need to initialize them from some sort of init function
> before they can be used. So for correct locking there has to be some
> sort of global initialization function called before getadmdir is used.
> Yes, I agree this sucks, but those are the breaks...
>
> -garrett
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jun 30 01:50:54 2005

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