Reset thread name in thread pool

This commit is contained in:
Alexey Milovidov 2022-04-11 01:03:24 +02:00
parent 3c14659ab2
commit f0fad98a73

View File

@ -1,4 +1,5 @@
#include <Common/ThreadPool.h>
#include <Common/setThreadName.h>
#include <Common/Exception.h>
#include <Common/getNumberOfPhysicalCPUCores.h>
@ -243,6 +244,9 @@ void ThreadPoolImpl<Thread>::worker(typename std::list<Thread>::iterator thread_
while (true)
{
/// This is inside the loop to also reset previous thread names set inside the jobs.
setThreadName("ThreadPoolIdle");
Job job;
bool need_shutdown = false;