Commit 5980795d authored by Dag Erling Smørgrav's avatar Dag Erling Smørgrav

Instead of incorrectly assuming that a pthread_t can be meaningfully cast

to an unsigned int (which triggered warnings on some 64-bit platforms) and
printed with %08lx, incorrectly assume that it can be meaningfully cast to
a void * and printed with %p.  While still incorrect in general terms, the
latter turns out to be correct on the specific systems that we care about.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1754 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 8796d0cc
......@@ -145,7 +145,7 @@ thread_log(int lvl, const char *fmt, ...)
if (lvl > debug)
return;
pthread_mutex_lock(&log_mutex);
fprintf(stderr, "%08x ", (unsigned int)pthread_self());
fprintf(stderr, "%p ", (void *)pthread_self());
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
......@@ -183,8 +183,8 @@ thread_get(int fd, void *(*thread_main)(void *))
mailbox_destroy(&threads[fd]->mbox);
freez(threads[fd]);
}
thread_log(1, "thread %08x started\n",
(unsigned int)threads[fd]->thread_id);
thread_log(1, "thread %p started\n",
(void *)threads[fd]->thread_id);
}
return (threads[fd]);
}
......@@ -204,8 +204,8 @@ thread_close(int fd)
return;
mailbox_close(&threads[fd]->mbox);
pthread_join(threads[fd]->thread_id, NULL);
thread_log(1, "thread %08x stopped\n",
(unsigned int)threads[fd]->thread_id);
thread_log(1, "thread %p stopped\n",
(void *)threads[fd]->thread_id);
mailbox_destroy(&threads[fd]->mbox);
freez(threads[fd]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment