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

Re: [PATCH] Client-side Cyrus SASL support

From: Vlad Georgescu <vgeorgescu_at_gmail.com>
Date: 2006-08-10 00:46:52 CEST

On 8/10/06, Philip Martin <philip@codematters.co.uk> wrote:
> "Vlad Georgescu" <vgeorgescu@gmail.com> writes:
>
> > +apr_status_t svn_ra_svn__sasl_common_init(void)
> > +{
> > + apr_status_t apr_err = APR_SUCCESS;
> > +
> > +#ifdef APR_HAS_THREADS
> > + sasl_set_mutex(sasl_mutex_alloc_cb,
> > + sasl_mutex_lock_cb,
> > + sasl_mutex_unlock_cb,
> > + sasl_mutex_free_cb);
> > + sasl_pool = svn_pool_create(NULL);
> > + apr_pool_cleanup_register(sasl_pool, NULL, sasl_done_cb,
> > + apr_pool_cleanup_null);
> > + free_mutexes = apr_array_make(sasl_pool, 0, sizeof(apr_thread_mutex_t *));
> > + apr_err = apr_thread_mutex_create(&array_mutex,
> > + APR_THREAD_MUTEX_DEFAULT,
> > + sasl_pool);
> > +#else
> > + atexit(sasl_done);
> > +#endif /* APR_HAS_THREADS */
> > + return apr_err;
> > +}
>
> I still think it's odd for the library to use atexit, and for the
> threaded/non-threaded code to be so different. Why doesn't the
> non-threaded code just use the threaded code but without the mutexes?

Sure, you could use the global pool and the pool cleanup in the
single-threaded case, but it doesn't really make sense. That pool is
only necessary for the mutex allocations, so you'd be creating a pool
just to register a cleanup for it.

-- 
Vlad
---------------------------------------------------------------------
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:47:22 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.