From cd4377fab21e0f500bef7f06543fa848a039c1e0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 20 Jul 2023 06:50:01 +0200 Subject: Merging upstream version 1.41.0. Signed-off-by: Daniel Baumann --- daemon/event_loop.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'daemon/event_loop.c') 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); } -- cgit v1.2.3