apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject cvs commit: apr/include/arch/unix inherit.h
Date Thu, 26 Jul 2001 15:03:17 GMT
jerenkrantz    01/07/26 08:03:17

  Modified:    include/arch/unix inherit.h
  Log:
  Do the "right" thing with inherit macros when SMS is enabled.
  This highlights the one major difference between pools and SMS - the
  cleanups are different.
  
  Revision  Changes    Path
  1.7       +24 -0     apr/include/arch/unix/inherit.h
  
  Index: inherit.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/unix/inherit.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- inherit.h	2001/07/24 04:45:46	1.6
  +++ inherit.h	2001/07/26 15:03:16	1.7
  @@ -59,6 +59,7 @@
   
   #define APR_INHERIT    (2^24)    /* Must not conflicts with other bits */
   
  +#ifndef APR_POOLS_ARE_SMS
   #define APR_IMPLEMENT_SET_INHERIT(name, flag, pool, cleanup)        \
   void apr_##name##_set_inherit(apr_##name##_t *name)                 \
   {                                                                   \
  @@ -68,7 +69,19 @@
                                      cleanup, apr_pool_cleanup_null); \
       }                                                               \
   }
  +#else
  +#define APR_IMPLEMENT_SET_INHERIT(name, flag, pool, cleanup)        \
  +void apr_##name##_set_inherit(apr_##name##_t *name)                 \
  +{                                                                   \
  +    if (!(name->flag & APR_INHERIT)) {                              \
  +        name->flag |= APR_INHERIT;                                  \
  +        apr_sms_cleanup_unregister(name->pool, APR_CHILD_CLEANUP,   \
  +                                   (void *)name, cleanup);          \
  +    }                                                               \
  +}
  +#endif
   
  +#ifndef APR_POOLS_ARE_SMS
   #define APR_IMPLEMENT_UNSET_INHERIT(name, flag, pool, cleanup)      \
   void apr_##name##_unset_inherit(apr_##name##_t *name)               \
   {                                                                   \
  @@ -78,5 +91,16 @@
                                      cleanup, cleanup);               \
       }                                                               \
   }
  +#else
  +#define APR_IMPLEMENT_UNSET_INHERIT(name, flag, pool, cleanup)      \
  +void apr_##name##_unset_inherit(apr_##name##_t *name)               \
  +{                                                                   \
  +    if (name->flag & APR_INHERIT) {                                 \
  +        name->flag &= ~APR_INHERIT;                                 \
  +        apr_sms_cleanup_register(name->pool, APR_CHILD_CLEANUP,     \
  +                                 (void *)name, cleanup);            \
  +    }                                                               \
  +}
  +#endif
   
   #endif	/* ! INHERIT_H */
  
  
  

Mime
View raw message