aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/ThreadPool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/ThreadPool.cpp')
-rw-r--r--llvm/lib/Support/ThreadPool.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Support/ThreadPool.cpp b/llvm/lib/Support/ThreadPool.cpp
index 31461e31c65c..4eef339000e1 100644
--- a/llvm/lib/Support/ThreadPool.cpp
+++ b/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 @@ void ThreadPool::grow(int requested) {
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);
});