[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-10 00:36:29 CEST

On 8/9/06, Philip Martin <philip@codematters.co.uk> wrote:
> Greg Hudson <ghudson@MIT.EDU> writes:
>
> > On Aug 9, 2006, at 5:33 PM, Philip Martin wrote:
> >>
> >> 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);
> >
> > Huh. Can you think of a case where it makes sense to pass parameters
> > to an atomic initialization function? My intuition is that if you
> > want to do that, your designed is subtly wrong.
>
> I suppose that's possible, but I think of the code:
>
> svn_error_t *foo(....)
> {
> ...
> SVN_ERR(svn_atomic_init_once(&once, some_func));
> ...
> }
>
> as more-or-less equivalent to:
>
> svn_error_t *foo(....)
> {
> ...
> SVN_ERR(some_func());
> ...
> }
>
> and it doesn't seem unreasonable to pass arguments to some_func.
> Suppose we wanted to use the application's apr_allocator_t when
> creating top-level pools in some_func? Using a global variable might
> work, but in that case we probably wouldn't need svn_atomic_init_once
> in the first place.

Realistically, I don't think this is a likely use case, but
fortunately, it doesn't matter. This is not a public interface, we
are not installing the header that describes it, so we can change it
later if it ever becomes necessary.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 10 00:37:07 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.