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

Re: svn commit: r21016 - in trunk: . subversion/include/private subversion/libsvn_fs_base/bdb subversion/libsvn_subr

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2006-08-09 23:57:47 CEST

On 8/9/06, Daniel Rall <dlr@collab.net> wrote:
> On Wed, 09 Aug 2006, Philip Martin wrote:
>
> > rooneg@tigris.org writes:
> >
> > > Author: rooneg
> > > Date: Tue Aug 8 08:34:59 2006
> > > New Revision: 21016
> >
> > > + * Call an initialization function in a thread-safe manner.
> > > + *
> > > + * @a global_status must be a pointer to a global, zero-initialized
> > > + * #svn_atomic_t. @a init_func is a pointer to the function that performs
> > > + * the actual initialization.
> > > + *
> > > + * @since New in 1.5.
> > > + */
> > > +svn_error_t *
> > > +svn_atomic_init_once(volatile svn_atomic_t *global_status,
> > > + svn_error_t *(*init_func)(void));
> >
> > Will this always be used in places where no parameters need to be
> > passed? How about:
> >
> > svn_error_t *
> > svn_atomic_init_once(volatile svn_atomic_t *global_status,
> > svn_error_t *(*init_func)(void *baton),
> > void *baton);
>
> I like Philip's suggestion -- it's a more forward-looking API.

Generally, if it's something that only has to occur once it's a global
initialization, which means you're initializing globals, so a baton is
unnecessary, but I suppose someone might come up with a reason to pass
one in, so sure, why not. Will look at adding one.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 9 23:58:20 2006

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.