From 95e8bdaa25c9bf840c41995aac3fb141468a72b3 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sun, 12 Jul 2020 09:42:08 -0700 Subject: threads: introduce and use rmdThreadsSetName() Now users can easily differentiate which rmd subtasks are busy by using top-like tools in show-threads mode. Also aids in troubleshooting... --- src/rmd_threads.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/rmd_threads.c') diff --git a/src/rmd_threads.c b/src/rmd_threads.c index cb81f84..69b98bf 100644 --- a/src/rmd_threads.c +++ b/src/rmd_threads.c @@ -43,6 +43,7 @@ #include #include +#include #include void rmdThreads(ProgData *pdata) { @@ -167,3 +168,7 @@ void rmdThreads(ProgData *pdata) { pdata->timer_alive = 0; pthread_join(timer_t,NULL); } + +void rmdThreadsSetName(const char *name) { + prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0); +} -- cgit v1.2.1