apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <bo...@rexursive.com>
Subject Re: apr_dbd_init
Date Fri, 07 Apr 2006 11:12:26 GMT
On Fri, 2006-03-31 at 11:00 +0100, Nick Kew wrote:
> --- apr_dbd.c   (revision 390371)
> +++ apr_dbd.c   (working copy)
> @@ -63,17 +63,32 @@
>      }
>  #endif
> 
> +static apr_status_t apr_dbd_term(void *ptr)
> +{
> +    /* set drivers to NULL so init can work again */
> +    drivers = NULL;
> +
> +    /* Everything else we need is handled by cleanups registered
> +     * when we created mutexes and loaded DSOs
> +     */
> +    return APR_SUCCESS;
> +}
> +
>  APU_DECLARE(apr_status_t) apr_dbd_init(apr_pool_t *pool)
>  {
>      apr_status_t ret = APR_SUCCESS;
> +
> +    if (drivers != NULL) {
> +        return APR_SUCCESS;
> +    }
>      drivers = apr_hash_make(pool);
> +    apr_pool_cleanup_register(pool, NULL, apr_dbd_term,
> +                              apr_pool_cleanup_null);
> 
> 
>  #if APR_HAS_THREADS
>      ret = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, pool);
> -    apr_pool_cleanup_register(pool, mutex,
> -                              CLEANUP_CAST apr_thread_mutex_destroy,
> -                              apr_pool_cleanup_null);
> +    /* This already registers a pool cleanup */
>  #endif
> 
>  #ifndef APR_DSO_BUILD

Any chance of a backport of this to 1.2.7?

-- 
Bojan


Mime
View raw message