[PATCH 1/2] Use sp->vsl_id as thread identifier

Rogier 'DocWilco' Mulhuijzen github at bsdchicks.com
Sun Jan 15 17:39:54 CET 2012


POSIX threads don't have a thread identifier that can be printed
in a portable manner.
---
 bin/varnishd/cache/cache_center.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/varnishd/cache/cache_center.c b/bin/varnishd/cache/cache_center.c
index 4967c82..a9d791e 100644
--- a/bin/varnishd/cache/cache_center.c
+++ b/bin/varnishd/cache/cache_center.c
@@ -1655,13 +1655,13 @@ cnt_diag(struct sess *sp, const char *state)
 	}
 
 	if (sp->wrk != NULL) {
-		WSP(sp, SLT_Debug, "thr %p STP_%s sp %p obj %p vcl %p",
-		    pthread_self(), state, sp, obj, vcl);
+		WSP(sp, SLT_Debug, "thr %x STP_%s sp %p obj %p vcl %p",
+		    sp->vsl_id, state, sp, obj, vcl);
 		WSL_Flush(sp->wrk, 0);
 	} else {
 		VSL(SLT_Debug, sp->vsl_id,
-		    "thr %p STP_%s sp %p obj %p vcl %p",
-		    pthread_self(), state, sp, obj, vcl);
+		    "thr %x STP_%s sp %p obj %p vcl %p",
+		    sp->vsl_id, state, sp, obj, vcl);
 	}
 }
 
-- 
1.7.5.4




More information about the varnish-dev mailing list