summaryrefslogtreecommitdiff
path: root/src/rmd_threads.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-07-12 09:42:08 -0700
committerVito Caputo <vcaputo@pengaru.com>2020-07-12 10:13:06 -0700
commit95e8bdaa25c9bf840c41995aac3fb141468a72b3 (patch)
tree6e16e6fc17f6313deb1c3de294966bd3dab557af /src/rmd_threads.c
parent46e9069fdbc58bd1febde1a493b1fe7aa9456527 (diff)
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...
Diffstat (limited to 'src/rmd_threads.c')
-rw-r--r--src/rmd_threads.c5
1 files changed, 5 insertions, 0 deletions
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 <stdio.h>
#include <stdlib.h>
+#include <sys/prctl.h>
#include <unistd.h>
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);
+}
© All Rights Reserved