summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-06-25 16:03:28 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-06-25 16:03:28 +0200
commit1f79c785975261e4158c9b85f6451d5bd00b2495 (patch)
treec25f95c629f62abbe35d431d60fc7449d0bb1668
parent46435e2c3b2ca31aca641aba290173142fae540c (diff)
downloadrsyslog-1f79c785975261e4158c9b85f6451d5bd00b2495.tar.gz
rsyslog-1f79c785975261e4158c9b85f6451d5bd00b2495.tar.xz
rsyslog-1f79c785975261e4158c9b85f6451d5bd00b2495.zip
named queue worker threads
... but I don't see the name anywhere...?
-rw-r--r--runtime/wtp.c6
-rw-r--r--tools/syslogd.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/runtime/wtp.c b/runtime/wtp.c
index 218a5db6..02662cde 100644
--- a/runtime/wtp.c
+++ b/runtime/wtp.c
@@ -40,6 +40,7 @@
#include <unistd.h>
#include <errno.h>
#include <atomic.h>
+#include <sys/prctl.h>
#ifdef OS_SOLARIS
# include <sched.h>
@@ -433,6 +434,11 @@ wtpWorker(void *arg) /* the arg is actually a wti object, even though we are in
sigfillset(&sigSet);
pthread_sigmask(SIG_BLOCK, &sigSet, NULL);
+ /* set thread name - we ignore if the call fails, has no harsh consequences... */
+ if(prctl(PR_SET_NAME, wtpGetDbgHdr(pThis), 0, 0, 0) != 0) {
+ DBGPRINTF("prctl failed, not setting thread name for '%s'\n", wtpGetDbgHdr(pThis));
+ }
+
BEGIN_MTX_PROTECTED_OPERATIONS(&pThis->mut, LOCK_MUTEX);
/* do some late initialization */
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 0fdaf5ba..8bc4939f 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -2272,7 +2272,7 @@ init(void)
exit(1);
}
/* name our main queue object (it's not fatal if it fails...) */
- obj.SetName((obj_t*) pMsgQueue, (uchar*) "main queue");
+ obj.SetName((obj_t*) pMsgQueue, (uchar*) "main Q");
/* ... set some properties ... */
# define setQPROP(func, directive, data) \