]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnstcpbench: name the worker threads
authorPieter Lexis <pieter.lexis@powerdns.com>
Thu, 27 Sep 2018 11:22:42 +0000 (13:22 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 27 Sep 2018 11:22:42 +0000 (13:22 +0200)
pdns/dnstcpbench.cc

index 2c6e7fb42e3c3229321549e47677958e98a06870..675731c701a4991ae7402a22ae730f2c8a65b8d7 100644 (file)
@@ -174,6 +174,11 @@ vector<BenchQuery> g_queries;
 
 static void* worker(void*)
 {
+  string threadName = "dnstcpb/worker";
+  auto retval = pthread_setname_np(pthread_self(), const_cast<char*>(threadName.c_str()));
+  if (retval != 0) {
+    cerr<<"Could not set thread name "<<threadName<<" for wthread: "<<strerror(retval)<<endl;
+  }
   for(;;) {
     unsigned int pos = g_pos++; 
     if(pos >= g_queries.size())