aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/upstream/upstreamcache.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-05-15 17:55:52 +0200
committerGitHub <[email protected]>2023-05-15 17:55:52 +0200
commit14f4baabfa56eedb7b71235b951e993da4f641ef (patch)
tree86c08838a0179ae15910b791a1412c448340020d /src/zenserver/upstream/upstreamcache.cpp
parentv0.2.11 (diff)
downloadzen-14f4baabfa56eedb7b71235b951e993da4f641ef.tar.xz
zen-14f4baabfa56eedb7b71235b951e993da4f641ef.zip
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
Diffstat (limited to 'src/zenserver/upstream/upstreamcache.cpp')
-rw-r--r--src/zenserver/upstream/upstreamcache.cpp7
1 files changed, 5 insertions, 2 deletions
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;