From 659f3e7718762205cabf078d3b68c72961f267cf Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 12 Apr 2016 01:12:17 -0400 Subject: even better thread names --- src/multipart-replace-http-server.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/multipart-replace-http-server.c b/src/multipart-replace-http-server.c index 792a26d..faec814 100644 --- a/src/multipart-replace-http-server.c +++ b/src/multipart-replace-http-server.c @@ -201,8 +201,11 @@ void connection_handler(int fd) { } void *connection_thread(void *arg_anon) { - pthread_setname_np(pthread_self(), "connection"); int fd = (int)(intptr_t)arg_anon; + + char name[16]; + snprintf(name, sizeof(name), "connection %d", fd); + pthread_setname_np(pthread_self(), name); log("Connection %d opened", fd); connection_handler(fd); log("Connection %d closed", fd); -- cgit v1.2.3-54-g00ecf