apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: apr/memory/unix apr_pools.c
Date Sat, 14 Jul 2001 22:31:38 GMT
rbb         01/07/14 15:31:38

  Modified:    include  apr_pools.h
               memory/unix apr_pools.c
  Log:
  Add a new function to be able to cancel a child cleanup.  This is
  necessary for some other work I am doing.
  
  Revision  Changes    Path
  1.53      +9 -0      apr/include/apr_pools.h
  
  Index: apr_pools.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_pools.h,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -d -b -w -u -r1.52 -r1.53
  --- apr_pools.h	2001/07/11 14:20:19	1.52
  +++ apr_pools.h	2001/07/14 22:31:37	1.53
  @@ -381,6 +381,15 @@
                                      apr_status_t (*cleanup)(void *));
   
   /**
  + * Remove a previously registered child cleanup function
  + * @param p The pool remove the cleanup from 
  + * @param data The data to remove from cleanup
  + * @param cleanup The function to remove from cleanup
  + */
  +APR_DECLARE(void) apr_pool_child_cleanup_kill(apr_pool_t *p, const void *data,
  +                                              apr_status_t (*cleanup) (void *));
  +
  +/**
    * Run the specified cleanup function immediately and unregister it. Use
    * @a data instead of the data that was registered with the cleanup.
    * @param p The pool remove the cleanup from 
  
  
  
  1.101     +21 -0     apr/memory/unix/apr_pools.c
  
  Index: apr_pools.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -u -d -b -w -u -r1.100 -r1.101
  --- apr_pools.c	2001/07/07 22:23:54	1.100
  +++ apr_pools.c	2001/07/14 22:31:38	1.101
  @@ -738,6 +738,27 @@
       }
   }
   
  +APR_DECLARE(void) apr_pool_child_cleanup_kill(apr_pool_t *p, const void *data,
  +				  	      apr_status_t (*cleanup) (void *))
  +{
  +    struct cleanup *c;
  +    struct cleanup **lastp;
  +
  +    if (p == NULL)
  +        return;
  +    c = p->cleanups;
  +    lastp = &p->cleanups;
  +    while (c) {
  +        if (c->data == data && c->child_cleanup == cleanup) {
  +            *lastp = c->next;
  +            break;
  +        }
  +
  +        lastp = &c->next;
  +        c = c->next;
  +    }
  +}
  +
   APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data,
                                          apr_status_t (*cleanup) (void *))
   {
  
  
  

Mime
View raw message