From 14f4baabfa56eedb7b71235b951e993da4f641ef Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Mon, 15 May 2023 17:55:52 +0200 Subject: all threads should be named (#304) * added WorkerThreadPool naming, packaged_task support * name the http.sys thread pool service threads * added http.sys I/O threadpool naming * upstream cache I/O thread naming --- src/zenserver/upstream/upstreamcache.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/zenserver/upstream/upstreamcache.cpp') diff --git a/src/zenserver/upstream/upstreamcache.cpp b/src/zenserver/upstream/upstreamcache.cpp index 245097796..2a9e67c06 100644 --- a/src/zenserver/upstream/upstreamcache.cpp +++ b/src/zenserver/upstream/upstreamcache.cpp @@ -1490,7 +1490,7 @@ public: { for (uint32_t Idx = 0; Idx < m_Options.ThreadCount; Idx++) { - m_UpstreamThreads.emplace_back(&UpstreamCacheImpl::ProcessUpstreamQueue, this); + m_UpstreamThreads.emplace_back(&UpstreamCacheImpl::ProcessUpstreamQueue, this, Idx + 1); } m_EndpointMonitorThread = std::thread(&UpstreamCacheImpl::MonitorEndpoints, this); @@ -1947,8 +1947,11 @@ private: } } - void ProcessUpstreamQueue() + void ProcessUpstreamQueue(int ThreadIndex) { + std::string ThreadName = fmt::format("upstream_{}", ThreadIndex); + SetCurrentThreadName(ThreadName); + for (;;) { UpstreamCacheRecord CacheRecord; -- cgit v1.2.3