summaryrefslogtreecommitdiffstats
path: root/runtime/wtp.c
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 /runtime/wtp.c
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...?
Diffstat (limited to 'runtime/wtp.c')
-rw-r--r--runtime/wtp.c6
1 files changed, 6 insertions, 0 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 */