You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@codematters.co.uk> on 2002/05/30 20:50:22 UTC

Re: svn commit: rev 2038 - trunk/subversion/libsvn_subr

striker@tigris.org writes:

> Author: striker
> Date: 2002-05-30 01:07 GMT
> New Revision: 2038
> 
> Modified:
>    trunk/subversion/libsvn_subr/svn_error.c
> Log:
> * subversion/libsvn_subr/svn_error.c
> 
>   (svn_pool_clear): If we clear the top level svn pool, make sure
>     we recreate a mutex for our own allocator.
> 
> 
> Modified: trunk/subversion/libsvn_subr/svn_error.c
> ==============================================================================
> --- trunk/subversion/libsvn_subr/svn_error.c	(original)
> +++ trunk/subversion/libsvn_subr/svn_error.c	Wed May 29 20:07:03 2002
> @@ -506,6 +506,19 @@
>  
>    if (subpool_of_p_p)
>      {
> +#if APR_HAS_THREADS
> +      /* At this point, the mutex we set on our own allocator will have
> +	 been destroyed.  Better create a new one.
> +       */
> +      apr_allocator_t *allocator;
> +      apr_thread_mutex_t *mutex;
> +
> +      allocator = apr_pool_allocator_get (pool);
> +      apr_allocator_mutex_set (allocator, NULL);
> +      (void) apr_thread_mutex_create (&mutex, APR_THREAD_MUTEX_DEFAULT, pool);

Why are you ignoring the error?  Should this be

        apr_err = apr_thread_mutex_create (...);
        if (apr_err)
           abort_on_pool_failure (apr_err);

> +      apr_allocator_mutex_set (allocator, mutex);
> +#endif /* APR_HAS_THREADS */
> +	
>        /* Here we have a problematic situation.  We cleared the pool P,
>           which invalidated all its userdata.  The problem is that as
>           far as we can tell, the error pool on this pool isn't a copy

-- 
Philip

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org