summaryrefslogtreecommitdiffstats
path: root/daemon/event_loop.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-20 04:50:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-20 04:50:01 +0000
commitcd4377fab21e0f500bef7f06543fa848a039c1e0 (patch)
treeba00a55e430c052d6bed0b61c0f8bbe8ebedd313 /daemon/event_loop.c
parentReleasing debian version 1.40.1-1. (diff)
downloadnetdata-cd4377fab21e0f500bef7f06543fa848a039c1e0.tar.xz
netdata-cd4377fab21e0f500bef7f06543fa848a039c1e0.zip
Merging upstream version 1.41.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'daemon/event_loop.c')
-rw-r--r--daemon/event_loop.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/daemon/event_loop.c b/daemon/event_loop.c
index 5fd02377e..fb3879154 100644
--- a/daemon/event_loop.c
+++ b/daemon/event_loop.c
@@ -56,5 +56,10 @@ void register_libuv_worker_jobs() {
// netdatacli
worker_register_job_name(UV_EVENT_SCHEDULE_CMD, "schedule command");
- uv_thread_set_name_np(pthread_self(), "LIBUV_WORKER");
+ static int workers = 0;
+ int worker_id = __atomic_add_fetch(&workers, 1, __ATOMIC_RELAXED);
+
+ char buf[NETDATA_THREAD_TAG_MAX + 1];
+ snprintfz(buf, NETDATA_THREAD_TAG_MAX, "UV_WORKER[%d]", worker_id);
+ uv_thread_set_name_np(pthread_self(), buf);
}