Author: stas
Date: Mon Dec 27 15:43:09 2004
New Revision: 123455

URL: http://svn.apache.org/viewcvs?view=rev&rev=123455
Log:
modperl_pid_tid:
- in case of non-threaded mpm return only the pid
- in case of threaded mpm, return the tid only when threads are started, 
otherwise return 0 for tid

Modified:
   perl/modperl/trunk/src/modules/perl/modperl_debug.c

Modified: perl/modperl/trunk/src/modules/perl/modperl_debug.c
Url: 
http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/modperl_debug.c?view=diff&rev=123455&p1=perl/modperl/trunk/src/modules/perl/modperl_debug.c&r1=123454&p2=perl/modperl/trunk/src/modules/perl/modperl_debug.c&r2=123455
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_debug.c (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_debug.c Mon Dec 27 15:43:09 2004
@@ -23,17 +23,25 @@
 /* used in debug traces */
 MP_INLINE char *modperl_pid_tid(apr_pool_t *p)
 {
-    return apr_psprintf(p, "%lu"
+    if (modperl_threaded_mpm()) {
+        return apr_psprintf(p, "%lu"
 #if APR_HAS_THREADS
-                 "/%lu"
+                            "/%lu"
 #endif /* APR_HAS_THREADS */
-                 , (unsigned long)getpid()
+                            , (unsigned long)getpid()
 #if APR_HAS_THREADS
-                 , (unsigned long)apr_os_thread_current()
+                            , modperl_threads_started()
+                            ? (unsigned long)apr_os_thread_current()
+                            : 0
 #endif /* APR_HAS_THREADS */
-        );
+            );
+    }
+    else {
+        return apr_psprintf(p, "%lu", (unsigned long)getpid());
+    }
 }
 
+    
 #ifdef MP_TRACE
 /* any non-false value for MOD_PERL_TRACE/PerlTrace enables this function */
 void modperl_apr_table_dump(pTHX_ apr_table_t *table, char *name)

Reply via email to