[PATCH] D144297: Name threadpool threads.

Benoit Jacob via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 10:11:47 PST 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG1215ff89cde6: Name threadpool threads. (authored by Benoit).

Changed prior to commit:
  https://reviews.llvm.org/D144297?vs=499868&id=499907#toc

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.499907.patch
Type: text/x-patch
Size: 699 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230223/9b38ce63/attachment.bin>


More information about the llvm-commits mailing list