[PATCH] D144297: Name threadpool threads.

Benoit Jacob via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 13:37:02 PST 2023


Benoit updated this revision to Diff 498499.
Benoit added a comment.

shorter


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144297/new/

https://reviews.llvm.org/D144297

Files:
  llvm/lib/Support/ThreadPool.cpp


Index: llvm/lib/Support/ThreadPool.cpp
===================================================================
--- llvm/lib/Support/ThreadPool.cpp
+++ llvm/lib/Support/ThreadPool.cpp
@@ -15,6 +15,7 @@
 #include "llvm/Config/llvm-config.h"
 
 #if LLVM_ENABLE_THREADS
+#include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/Threading.h"
 #else
 #include "llvm/Support/raw_ostream.h"
@@ -43,6 +44,7 @@
   while (static_cast<int>(Threads.size()) < newThreadCount) {
     int ThreadID = Threads.size();
     Threads.emplace_back([this, ThreadID] {
+      set_thread_name(formatv("llvm-worker{0}", ThreadID));
       Strategy.apply_thread_strategy(ThreadID);
       processTasks(nullptr);
     });


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144297.498499.patch
Type: text/x-patch
Size: 698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230217/33310c4a/attachment.bin>


More information about the llvm-commits mailing list