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

Re: svn commit: r1540590 - bad use of SVN_INT_ERR

From: Stefan Fuhrmann <stefan.fuhrmann_at_wandisco.com>
Date: Thu, 21 Nov 2013 05:00:56 +0100

On Wed, Nov 20, 2013 at 6:00 PM, Julian Foad <julianfoad_at_btopenworld.com>wrote:

> > URL: http://svn.apache.org/r1540590
>
>
> > Added: subversion/trunk/subversion/libsvn_subr/object_pool.c
> >
> ==============================================================================
> [...]
> > +/* Cleanup function called when an object_ref_t gets released.
> > + */
> > +static apr_status_t
> > +object_ref_cleanup(void *baton)
> > +{
> > + object_ref_t *object = baton;
> > + svn_object_pool__t *object_pool = object->object_pool;
> > +
> > + SVN_INT_ERR(svn_mutex__lock(object_pool->mutex));
>
> This doesn't do quite what you might think. (And it's doc string is not
> clear about this.) It also prints out the error message. I don't think
> that's what you want here.
>

Thanks for pointing that out, Julian!

> [...]
> > + SVN_INT_ERR(svn_mutex__unlock(object_pool->mutex, NULL));
>
> And again.
>

I think there is no real point in continuing program execution once
mutexes / thread synchronization fail in resource management code.
r1544027 attempts a clean exit in that case.

-- Stefan^2.
Received on 2013-11-21 05:01:37 CET

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