stas        2003/09/18 00:44:24

  Modified:    src/modules/perl modperl_util.c modperl_util.h
  Log:
  new helper function for tracing: modperl_pid_tid - return $pid/$tid of the
  current thread or a process
  
  Revision  Changes    Path
  1.53      +15 -0     modperl-2.0/src/modules/perl/modperl_util.c
  
  Index: modperl_util.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -u -r1.52 -r1.53
  --- modperl_util.c    30 Aug 2003 02:33:26 -0000      1.52
  +++ modperl_util.c    18 Sep 2003 07:44:24 -0000      1.53
  @@ -289,6 +289,21 @@
       return apr_psprintf(p, "%s:%u", s->server_hostname, s->port);
   }
   
  +/* used in debug traces */
  +MP_INLINE char *modperl_pid_tid(apr_pool_t *p)
  +{
  +    return apr_psprintf(p, "%lu"
  +#if APR_HAS_THREADS
  +                 "/%lu"
  +#endif /* APR_HAS_THREADS */
  +                 , (unsigned long)getpid()
  +#if APR_HAS_THREADS
  +                 , (unsigned long)apr_os_thread_current()
  +#endif /* APR_HAS_THREADS */
  +        );
  +}
  +
  +    
   #define dl_librefs "DynaLoader::dl_librefs"
   #define dl_modules "DynaLoader::dl_modules"
   
  
  
  
  1.47      +2 -0      modperl-2.0/src/modules/perl/modperl_util.h
  
  Index: modperl_util.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -u -r1.46 -r1.47
  --- modperl_util.h    30 Aug 2003 02:33:26 -0000      1.46
  +++ modperl_util.h    18 Sep 2003 07:44:24 -0000      1.47
  @@ -97,6 +97,8 @@
   
   char *modperl_server_desc(server_rec *s, apr_pool_t *p);
   
  +MP_INLINE char *modperl_pid_tid(apr_pool_t *p);
  +
   void modperl_xs_dl_handles_clear(pTHX);
   
   void **modperl_xs_dl_handles_get(pTHX);
  
  
  

Reply via email to